From a9d0d8de0bd30fde69a93de4313f3b35060fd94e Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Thu, 5 Sep 2019 17:23:07 +0300 Subject: Better errors (TamTam errors now implements error interface) --- models.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'models.go') diff --git a/models.go b/models.go index f449958..5870cb9 100644 --- a/models.go +++ b/models.go @@ -228,9 +228,13 @@ type ContactAttachmentRequestPayload struct { // Server returns this if there was an exception to your request type Error struct { - Error string `json:"error,omitempty"` // Error - Code string `json:"code"` // Error code - Message string `json:"message"` // Human-readable description + ErrorText string `json:"error,omitempty"` // Error + Code string `json:"code"` // Error code + Message string `json:"message"` // Human-readable description +} + +func (e Error) Error() string { + return e.ErrorText } type FileAttachment struct { -- cgit v1.2.3