Improved error logging
This commit is contained in:
@ -17,7 +17,7 @@ func editorList(ctx *aero.Context, title string, filter func(*arn.Anime) bool, s
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil || (user.Role != "admin" && user.Role != "editor") {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized", nil)
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized")
|
||||
}
|
||||
|
||||
animes, count := filterAnime(ctx, user, filter)
|
||||
|
@ -17,7 +17,7 @@ func editorList(ctx *aero.Context, title string, filter func(*arn.SoundTrack) bo
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil || (user.Role != "admin" && user.Role != "editor") {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized", nil)
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized")
|
||||
}
|
||||
|
||||
tracks, count := filterSoundTracks(ctx, user, filter)
|
||||
|
@ -21,18 +21,18 @@ func Start(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil || (user.Role != "editor" && user.Role != "admin") {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized", nil)
|
||||
return ctx.Error(http.StatusUnauthorized, "Not authorized")
|
||||
}
|
||||
|
||||
jobName := ctx.Get("job")
|
||||
job := jobInfo[jobName]
|
||||
|
||||
if job == nil {
|
||||
return ctx.Error(http.StatusBadRequest, "Job not available", nil)
|
||||
return ctx.Error(http.StatusBadRequest, "Job not available")
|
||||
}
|
||||
|
||||
if job.IsRunning() {
|
||||
return ctx.Error(http.StatusBadRequest, "Job is currently running!", nil)
|
||||
return ctx.Error(http.StatusBadRequest, "Job is currently running!")
|
||||
}
|
||||
|
||||
job.Start()
|
||||
|
Reference in New Issue
Block a user