|
|
@ -44,7 +44,7 @@ func ResponseEncoder(w stdhttp.ResponseWriter, r *stdhttp.Request, v interface{} |
|
|
|
|
|
|
|
|
|
|
|
func ErrorEncoderPro(w stdhttp.ResponseWriter, r *stdhttp.Request, err error) { |
|
|
|
func ErrorEncoderPro(w stdhttp.ResponseWriter, r *stdhttp.Request, err error) { |
|
|
|
se := errors.FromError(err) |
|
|
|
se := errors.FromError(err) |
|
|
|
if !errors.Is(err, &errors.Error{}) { |
|
|
|
if _, ok := err.(*errors.Error); !ok { |
|
|
|
se.Reason = "InternalServerError" |
|
|
|
se.Reason = "InternalServerError" |
|
|
|
se.Code = stdhttp.StatusInternalServerError |
|
|
|
se.Code = stdhttp.StatusInternalServerError |
|
|
|
se.Message = "internal server error" |
|
|
|
se.Message = "internal server error" |
|
|
|