api: fixed null pointer exception
@@ -352,7 +352,10 @@ func (e *errResponse) marshalJSON(arena *fastjson.Arena) ([]byte, error) {
o := arena.NewObject()
o.Set("status", arena.NewString("Bad request."))
+
+ if e.Err != nil {
o.Set("error", arena.NewString(e.Err.Error()))
+ }
return o.MarshalTo(nil), nil
}
