From 8c4f3a1309e0beabf736c7c4bc4fea7b108e1aea Mon Sep 17 00:00:00 2001 From: n0m1s Date: Wed, 18 Sep 2019 09:28:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Better=20error=20message=20when?= =?UTF-8?q?=20bad=20int=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jdr/type.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdr/type.go b/jdr/type.go index b4de5a3..f328a1a 100644 --- a/jdr/type.go +++ b/jdr/type.go @@ -3,6 +3,7 @@ package jdr import( "html/template" + "fmt" "log" "errors" "strings" @@ -91,7 +92,7 @@ func (self *VariableType_int) ToInt(value JsonValue) (int64, error) { if isInt { val = int64(val2) } else { - return 0, errors.New("Not int")) + return 0, errors.New("Bad int type: " + fmt.Sprintf("%T", value)) } }