Skip to content

Commit

Permalink
feat: log out 504 and 500 errors as warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Nov 26, 2024
1 parent 07b9572 commit 40bfc99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/apis/applemusic/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ func sendAPIRequest[T any](endpoint string) (T, error) {
"status code of %d returned from apple music API. Code of 200 expected",
resp.StatusCode,
)
lumber.Error(err)
if resp.StatusCode == http.StatusBadGateway ||
resp.StatusCode == http.StatusInternalServerError {
lumber.Warning(err)
} else {
lumber.Error(err)
}
return zeroValue, err
}

Expand Down

0 comments on commit 40bfc99

Please sign in to comment.