Added logging
This commit is contained in:
parent
091711f4c5
commit
e93cba7108
24 changed files with 1596 additions and 10 deletions
|
|
@ -26,12 +26,15 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
|
|||
|
||||
// Check rights
|
||||
if !c.CObject.CanCreate(¤tUser) {
|
||||
models.Log.Noticef("%s [ID: %d] tried to create while not having the rights for it", currentUser.Username, currentUser.ID)
|
||||
return echo.NewHTTPError(http.StatusForbidden)
|
||||
}
|
||||
|
||||
// Create
|
||||
err = c.CObject.Create(¤tUser)
|
||||
if err != nil {
|
||||
models.Log.Error(err.Error())
|
||||
|
||||
if models.IsErrListDoesNotExist(err) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, "The list does not exist.")
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue