mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 23:09:02 +00:00
Some error handling work
This commit is contained in:
@@ -138,6 +138,13 @@ func (api *WebAPI) GetLog(r *Request) {
|
||||
|
||||
logs := api.Database.GetLogs(req.Since, req.Level)
|
||||
|
||||
if logs == nil {
|
||||
r.Json(JsonResponse{
|
||||
Ok: false,
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"getLogRequest": req,
|
||||
"logCount": len(*logs),
|
||||
|
||||
Reference in New Issue
Block a user