From: Matt Corallo Date: Thu, 14 Jun 2018 22:03:16 +0000 (-0400) Subject: Make PeerHandleError Error impl public X-Git-Tag: v0.0.12~404^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2018-06-api-quirks;p=rust-lightning Make PeerHandleError Error impl public --- diff --git a/src/ln/peer_handler.rs b/src/ln/peer_handler.rs index 9df01489f..7b140b079 100644 --- a/src/ln/peer_handler.rs +++ b/src/ln/peer_handler.rs @@ -8,7 +8,7 @@ use util::events::{EventsProvider,Event}; use std::collections::{HashMap,LinkedList}; use std::sync::{Arc, Mutex}; -use std::{cmp,mem,hash,fmt}; +use std::{cmp,error,mem,hash,fmt}; pub struct MessageHandler { pub chan_handler: Arc, @@ -48,6 +48,16 @@ impl fmt::Debug for PeerHandleError { formatter.write_str("Peer Sent Invalid Data") } } +impl fmt::Display for PeerHandleError { + fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { + formatter.write_str("Peer Sent Invalid Data") + } +} +impl error::Error for PeerHandleError { + fn description(&self) -> &str { + "Peer Sent Invalid Data" + } +} struct Peer { channel_encryptor: PeerChannelEncryptor,