Improved error logging

This commit is contained in:
2018-07-07 12:42:00 +09:00
parent bf544836fa
commit e46c9b1586
41 changed files with 69 additions and 65 deletions

View File

@ -13,7 +13,7 @@ func Get(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
return ctx.HTML(components.ImportLists(user))

View File

@ -16,7 +16,7 @@ func Preview(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -33,7 +33,7 @@ func Finish(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -76,7 +76,7 @@ func getMatches(ctx *aero.Context) ([]*arn.AniListMatch, string) {
user := utils.GetUser(ctx)
if user == nil {
return nil, ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return nil, ctx.Error(http.StatusBadRequest, "Not logged in")
}
// Get user

View File

@ -15,7 +15,7 @@ func Preview(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -32,7 +32,7 @@ func Finish(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -87,7 +87,7 @@ func getMatches(ctx *aero.Context) ([]*arn.KitsuMatch, string) {
user := utils.GetUser(ctx)
if user == nil {
return nil, ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return nil, ctx.Error(http.StatusBadRequest, "Not logged in")
}
kitsuUser, err := kitsu.GetUser(user.Accounts.Kitsu.Nick)

View File

@ -16,7 +16,7 @@ func Preview(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -33,7 +33,7 @@ func Finish(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return ctx.Error(http.StatusBadRequest, "Not logged in")
}
matches, response := getMatches(ctx)
@ -83,7 +83,7 @@ func getMatches(ctx *aero.Context) ([]*arn.MyAnimeListMatch, string) {
user := utils.GetUser(ctx)
if user == nil {
return nil, ctx.Error(http.StatusBadRequest, "Not logged in", nil)
return nil, ctx.Error(http.StatusBadRequest, "Not logged in")
}
malAnimeList, err := mal.GetAnimeList(user.Accounts.MyAnimeList.Nick)