Przeglądaj źródła

Improve error handling

Unknwon 8 lat temu
rodzic
commit
b481927d5e
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      models/user.go
  2. 1 1
      modules/context/context.go

+ 1 - 1
models/user.go

@@ -373,7 +373,7 @@ func (u *User) UploadAvatar(data []byte) error {
 
 // DeleteAvatar deletes the user's custom avatar.
 func (u *User) DeleteAvatar() error {
-	log.Trace("DeleteAvatar[%d]: %s", u.ID, u.CustomAvatarPath())
+	log.Trace("DeleteAvatar [%d]: %s", u.ID, u.CustomAvatarPath())
 	os.Remove(u.CustomAvatarPath())
 
 	u.UseCustomAvatar = false

+ 1 - 1
modules/context/context.go

@@ -94,7 +94,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
 		ctx.Data["Title"] = "Page Not Found"
 	case 500:
 		ctx.Data["Title"] = "Internal Server Error"
-		log.Error(4, "%s: %v", title, err)
+		log.Error(2, "%s: %v", title, err)
 		if !setting.ProdMode || (ctx.IsSigned && ctx.User.IsAdmin) {
 			ctx.Data["ErrorMsg"] = err
 		}