Skip to content

Commit

Permalink
feat: log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
senior-sigan committed Aug 11, 2023
1 parent 471a44d commit 1b3318f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,23 @@ func ShowIndex(w http.ResponseWriter, r *http.Request) {
}
dailyReport, err := reporter.BuildDailyReport(user.WorkspaceId, startDate)
if err != nil {
log.Printf("[ERROR] %v", err.Error())
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}

weeklyReport, err := reporter.BuildReport(user.WorkspaceId, startDate.AddDate(0, 0, -7), startDate)
if err != nil {
log.Printf("[ERROR] %v", err.Error())
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}

reportJson, err := json.Marshal(dailyReport)
if err != nil {
log.Printf("[ERROR] %v", err.Error())
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}

achievementsList := make(map[string]achievements.UserAchievement)
Expand Down

0 comments on commit 1b3318f

Please sign in to comment.