From ca03e976976a03d278da227fe1ec9966f23484ba Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Thu, 26 Mar 2015 13:33:44 +0100 Subject: Add InvalidTypeError --- rpc/messages.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rpc/messages.go') 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 -- cgit