cloudapi/v2: add details for non-service errors
In case Echo throws an error, or in case even echo doesn't manage to catch an underlying error and wrap it, return as many details as possible.
This commit is contained in:
parent
39d2068d31
commit
86fd957c9d
1 changed files with 2 additions and 2 deletions
|
|
@ -308,14 +308,14 @@ func HTTPErrorHandler(echoError error, c echo.Context) {
|
|||
he, ok := echoError.(*echo.HTTPError)
|
||||
if !ok {
|
||||
c.Logger().Errorf("ErrorNotHTTPError %v", echoError)
|
||||
doResponse(nil, ErrorNotHTTPError, c, echoError)
|
||||
doResponse(echoError.Error(), ErrorNotHTTPError, c, echoError)
|
||||
return
|
||||
}
|
||||
|
||||
err, ok := he.Message.(detailsError)
|
||||
if !ok {
|
||||
// No service code was set, so Echo threw this error
|
||||
doResponse(nil, apiErrorFromEchoError(he), c, he.Internal)
|
||||
doResponse(he.Error(), apiErrorFromEchoError(he), c, he.Internal)
|
||||
return
|
||||
}
|
||||
doResponse(err.details, err.errorCode, c, he.Internal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue