aboutsummaryrefslogtreecommitdiffstats
path: root/eth/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-06 00:10:42 +0800
committerobscuren <geffobscura@gmail.com>2015-01-06 00:10:42 +0800
commit6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2 (patch)
treeb898711590694cfaa6f10dbc2a4c8591232954ef /eth/error.go
parentb0854fbff5c3d588134f577918a39d08002235dc (diff)
downloaddexon-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.gz
dexon-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.zst
dexon-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.zip
Merge
Diffstat (limited to 'eth/error.go')
-rw-r--r--eth/error.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/eth/error.go b/eth/error.go
index d1daad575..1d9f80638 100644
--- a/eth/error.go
+++ b/eth/error.go
@@ -52,18 +52,17 @@ func ProtocolError(code int, format string, params ...interface{}) (err *protoco
}
func (self protocolError) Error() (message string) {
- message = self.message
- if message == "" {
- message, ok := errorToString[self.Code]
+ if len(message) == 0 {
+ var ok bool
+ self.message, ok = errorToString[self.Code]
if !ok {
panic("invalid error code")
}
if self.format != "" {
- message += ": " + fmt.Sprintf(self.format, self.params...)
+ self.message += ": " + fmt.Sprintf(self.format, self.params...)
}
- self.message = message
}
- return
+ return self.message
}
func (self *protocolError) Fatal() bool {