chore(web): always set internal error
(cherry picked from commit 5c56d07215a2a1fac63c565eac669fe8c1f19cbc)
This commit is contained in:
@ -43,15 +43,15 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
|
||||
log.Debugf("Invalid model error. Internal error was: %s", err.Error())
|
||||
var he *echo.HTTPError
|
||||
if errors.As(err, &he) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid model provided. Error was: %s", he.Message))
|
||||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid model provided. Error was: %s", he.Message)).SetInternal(err)
|
||||
}
|
||||
return echo.NewHTTPError(http.StatusBadRequest, "Invalid model provided.")
|
||||
return echo.NewHTTPError(http.StatusBadRequest, "Invalid model provided.").SetInternal(err)
|
||||
}
|
||||
|
||||
// Check if the user has the right to delete
|
||||
currentAuth, err := auth.GetAuthFromClaims(ctx)
|
||||
if err != nil {
|
||||
return echo.NewHTTPError(http.StatusInternalServerError)
|
||||
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
|
||||
}
|
||||
|
||||
// Create the db session
|
||||
|
Reference in New Issue
Block a user