Skip to content

Commit

Permalink
fix: use int64 in 4xx checking code func
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrMatsko committed Sep 24, 2024
1 parent 2854ea1 commit 0fa8b25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/handler/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func createTrigger(writer http.ResponseWriter, request *http.Request) {
}
}

func is4xxCode(statusCode int) bool {
func is4xxCode(statusCode int64) bool {
return statusCode >= 400 && statusCode < 500
}

Expand All @@ -175,7 +175,7 @@ func errorResponseOnPrometheusError(promErr *prometheus.Error) *api.ErrorRespons
http.StatusForbidden: {},
}

if _, leadTo500 := codes4xxLeadTo500[statusCode]; is4xxCode(int(statusCode)) && !leadTo500 {
if _, leadTo500 := codes4xxLeadTo500[statusCode]; is4xxCode(statusCode) && !leadTo500 {
return api.ErrorInvalidRequest(promErr)
}

Expand Down

0 comments on commit 0fa8b25

Please sign in to comment.