aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer_error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-15 19:22:03 +0800
committerobscuren <geffobscura@gmail.com>2014-12-15 19:22:03 +0800
commitbd9088792b0a7bcac00f28289a08bd1b8359316f (patch)
tree5d42f64861a8b30c0ba12719e79d0c456d1a501a /p2p/peer_error.go
parentcdb2ebbdfa510294b8443e33c32f9e0ec414f78e (diff)
parentc3ba4ace64a99d324b20b27574b5e5066ce14e54 (diff)
downloadgo-tangerine-bd9088792b0a7bcac00f28289a08bd1b8359316f.tar.gz
go-tangerine-bd9088792b0a7bcac00f28289a08bd1b8359316f.tar.zst
go-tangerine-bd9088792b0a7bcac00f28289a08bd1b8359316f.zip
Merge branch 'develop' into ethersphere-ethp2p
Diffstat (limited to 'p2p/peer_error.go')
-rw-r--r--p2p/peer_error.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/p2p/peer_error.go b/p2p/peer_error.go
index 88b870fbd..0eb7ec838 100644
--- a/p2p/peer_error.go
+++ b/p2p/peer_error.go
@@ -100,7 +100,16 @@ func (d DiscReason) String() string {
return discReasonToString[d]
}
+type discRequestedError DiscReason
+
+func (err discRequestedError) Error() string {
+ return fmt.Sprintf("disconnect requested: %v", DiscReason(err))
+}
+
func discReasonForError(err error) DiscReason {
+ if reason, ok := err.(discRequestedError); ok {
+ return DiscReason(reason)
+ }
peerError, ok := err.(*peerError)
if !ok {
return DiscSubprotocolError