add too many requests status

This commit is contained in:
Maycon Santos
2025-05-08 00:01:27 +02:00
parent 84126f9425
commit 921b5606ce
2 changed files with 4 additions and 0 deletions

View File

@@ -106,6 +106,8 @@ func WriteError(ctx context.Context, err error, w http.ResponseWriter) {
httpStatus = http.StatusUnauthorized
case status.BadRequest:
httpStatus = http.StatusBadRequest
case status.StatusTooManyRequests:
httpStatus = http.StatusTooManyRequests
default:
}
msg = strings.ToLower(err.Error())

View File

@@ -37,6 +37,8 @@ const (
// Unauthenticated indicates that user is not authenticated due to absence of valid credentials
Unauthenticated Type = 10
StatusTooManyRequests = 11
)
// Type is a type of the Error