Merge
This commit is contained in:
11
eth/error.go
11
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 {
|
||||
|
Reference in New Issue
Block a user