From 0595dbee37028a862d002d2fb4e30054cb03fd1d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 14 Jun 2018 18:03:16 -0400 Subject: [PATCH] Make PeerHandleError Error impl public --- src/ln/peer_handler.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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, -- 2.39.5