From 9e6fa304326efbc3492ea1d0b9ef9b2ab595a326 Mon Sep 17 00:00:00 2001 From: scoiatael Date: Thu, 9 Mar 2017 16:22:10 +0100 Subject: [PATCH] Send non-empty error It seems iris does serialize error to {} - hence convert it to string beforehand --- http/iris.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/iris.go b/http/iris.go index 259d0b2..aa92d79 100644 --- a/http/iris.go +++ b/http/iris.go @@ -19,7 +19,7 @@ func (hc IrisHttpContext) SendJson(response interface{}) { func (hc IrisHttpContext) ServerErr(err error) { hc.context.HandleErr(err) - hc.JSON(iris.StatusInternalServerError, iris.Map{"error": err}) + hc.JSON(iris.StatusInternalServerError, iris.Map{"error": err.Error()}) } func (hc IrisHttpContext) GetSegment(index string) string {