Add more logging

This commit is contained in:
kolaente 2020-02-08 22:44:21 +01:00
parent 9947104b77
commit c906493694
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
5 changed files with 25 additions and 5 deletions

View File

@ -62,5 +62,9 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
return HandleHTTPError(err, ctx)
}
return ctx.JSON(http.StatusCreated, currentStruct)
err = ctx.JSON(http.StatusCreated, currentStruct)
if err != nil {
return HandleHTTPError(err, ctx)
}
return err
}

View File

@ -59,5 +59,9 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
return HandleHTTPError(err, ctx)
}
return ctx.JSON(http.StatusOK, message{"Successfully deleted."})
err = ctx.JSON(http.StatusOK, message{"Successfully deleted."})
if err != nil {
return HandleHTTPError(err, ctx)
}
return err
}

View File

@ -104,5 +104,9 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
ctx.Response().Header().Set("x-pagination-result-count", strconv.FormatInt(int64(resultCount), 10))
ctx.Response().Header().Set("Access-Control-Expose-Headers", "x-pagination-total-pages, x-pagination-result-count")
return ctx.JSON(http.StatusOK, result)
err = ctx.JSON(http.StatusOK, result)
if err != nil {
return HandleHTTPError(err, ctx)
}
return err
}

View File

@ -55,5 +55,9 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
return HandleHTTPError(err, ctx)
}
return ctx.JSON(http.StatusOK, currentStruct)
err = ctx.JSON(http.StatusOK, currentStruct)
if err != nil {
return HandleHTTPError(err, ctx)
}
return err
}

View File

@ -61,5 +61,9 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
return HandleHTTPError(err, ctx)
}
return ctx.JSON(http.StatusOK, currentStruct)
err = ctx.JSON(http.StatusOK, currentStruct)
if err != nil {
return HandleHTTPError(err, ctx)
}
return err
}