Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Send non-empty error
Browse files Browse the repository at this point in the history
It seems iris does serialize error to {} - hence convert it to string beforehand
  • Loading branch information
scoiatael committed Mar 9, 2017
1 parent a7cf80b commit 9e6fa30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http/iris.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9e6fa30

Please sign in to comment.