From a7827cecab589985ac131a58c30a11e13ba392e8 Mon Sep 17 00:00:00 2001 From: Matt Gleich Date: Tue, 26 Nov 2024 00:50:40 -0500 Subject: [PATCH] feat: log our 504 and 500 errors as warnings Signed-off-by: Matt Gleich --- internal/apis/applemusic/api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/apis/applemusic/api.go b/internal/apis/applemusic/api.go index db91f66..f61bdea 100644 --- a/internal/apis/applemusic/api.go +++ b/internal/apis/applemusic/api.go @@ -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 }