Improve error message.
[rust-lightning] / lightning / src / ln / msgs.rs
index 24e8120de6cc4e14c32fd07d95903621b1f9a2eb..bd5d23504b19961b63224c301853ce26971fd68e 100644 (file)
@@ -461,7 +461,7 @@ pub enum ErrorAction {
 /// An Err type for failure to process messages.
 pub struct LightningError {
        /// A human-readable message describing the error
-       pub err: &'static str,
+       pub err: String,
        /// The action which should be taken against the offending peer.
        pub action: ErrorAction,
 }
@@ -701,7 +701,7 @@ impl fmt::Display for DecodeError {
 
 impl fmt::Debug for LightningError {
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-               f.write_str(self.err)
+               f.write_str(self.err.as_str())
        }
 }