cloudapi/v2: include details in case internal error is set

In case details aren't explicitly given, and the internal error is set,
include the internal error message in the details.
This commit is contained in:
Sanne Raymaekers 2024-06-25 12:03:48 +02:00
parent 5ce8f65a58
commit 135dd94de5
4 changed files with 31 additions and 34 deletions

View file

@ -77,7 +77,7 @@ func (h *apiHandlers) GetError(ctx echo.Context, id string) error {
return HTTPError(ErrorInvalidErrorId)
}
apiError := APIError(ServiceErrorCode(errorId), nil, ctx, nil)
apiError := APIError(find(ServiceErrorCode(errorId)), ctx, nil)
// If the service error wasn't found, it's a 404 in this instance
if apiError.Id == fmt.Sprintf("%d", ErrorServiceErrorNotFound) {
return HTTPError(ErrorErrorNotFound)