aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/messages.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 20:33:44 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 20:33:44 +0800
commitca03e976976a03d278da227fe1ec9966f23484ba (patch)
tree408eb00bb54ccc10d831523690289d85b53a1f9e /rpc/messages.go
parentc139af582663d760f58e7b50dcb9f355c47ef47e (diff)
downloadgo-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar.gz
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar.bz2
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar.lz
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar.xz
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.tar.zst
go-tangerine-ca03e976976a03d278da227fe1ec9966f23484ba.zip
Add InvalidTypeError
Diffstat (limited to 'rpc/messages.go')
-rw-r--r--rpc/messages.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/rpc/messages.go b/rpc/messages.go
index 7f5ebab11..5c498234f 100644
--- a/rpc/messages.go
+++ b/rpc/messages.go
@@ -21,6 +21,22 @@ import (
"fmt"
)
+type InvalidTypeError struct {
+ method string
+ msg string
+}
+
+func (e *InvalidTypeError) Error() string {
+ return fmt.Sprintf("invalid type on field %s: %s", e.method, e.msg)
+}
+
+func NewInvalidTypeError(method, msg string) *InvalidTypeError {
+ return &InvalidTypeError{
+ method: method,
+ msg: msg,
+ }
+}
+
type InsufficientParamsError struct {
have int
want int