Skip to content

Commit

Permalink
api: rest: Fix return code of internal error
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Jan 5, 2024
1 parent 5e4de88 commit 2059926
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/api/rest/common/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ func ReturnErrorMsg(c echo.Context, msg string) error {
func ReturnInternalError(c echo.Context, err error, reason string) error {
logger.Println(logger.ERROR, true, err.Error())

return ReturnErrorMsg(c, "Internal error occurred. (Reason: "+reason+", Error: "+err.Error()+")")
msg := "Internal error occurred. (Reason: " + reason + ", Error: " + err.Error() + ")"

return c.JSONPretty(http.StatusInternalServerError, ErrorResponse{Error: msg}, " ")
}

0 comments on commit 2059926

Please sign in to comment.