]> git.bitcoin.ninja Git - rust-lightning/commit
Improve error message.
authorjoe.miyamoto <joe.miyamoto@bitcoinbank.co.jp>
Mon, 13 Jul 2020 04:16:32 +0000 (13:16 +0900)
committerjoe.miyamoto <joe.miyamoto@bitcoinbank.co.jp>
Wed, 22 Jul 2020 01:34:47 +0000 (10:34 +0900)
commit1fc6d6b5ee2451862768979399e381611ef00565
tree347fb0e92a87ca59f20bdfe12d666fc85a1db111
parentbb369b5c18084323b6e34fa5a2cd72ecb4ada8ea
Improve error message.

... for ChannelError and APIMisuseError
Before this commit, When rl returns error, we don't know
The actual parameter which caused the error.
By returning parameterised `String` instead of predefined `&'static str`,
We can give a caller improved error message.

TestLogger now has two additional methods
1. `assert_log_contains` which checks the logged messsage
  has how many entry which includes the specified string as a substring.
2. `aasert_log_regex` mostly the same with `assert_log_contains`
  but it is more flexible that caller specifies regex which has
  to be satisfied instead of just a substring.
For regex, tests now includes `regex` as dev-dependency.
13 files changed:
lightning/Cargo.toml
lightning/src/lib.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/msgs.rs
lightning/src/ln/onion_utils.rs
lightning/src/ln/peer_channel_encryptor.rs
lightning/src/routing/network_graph.rs
lightning/src/routing/router.rs
lightning/src/util/errors.rs
lightning/src/util/test_utils.rs