Skip to content

Commit 16a3f89

Browse files
author
Bernhard B
committed
return HTTP status code 429 in case of rate limiting
1 parent 0757c3b commit 16a3f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func (a *Api) SendV2(c *gin.Context) {
414414
case *client.RateLimitErrorType:
415415
if rateLimitError, ok := err.(*client.RateLimitErrorType); ok {
416416
extendedError := errors.New(err.Error() + ". Use the attached challenge tokens to lift the rate limit restrictions via the '/v1/accounts/{number}/rate-limit-challenge' endpoint.")
417-
c.JSON(400, SendMessageError{Msg: extendedError.Error(), ChallengeTokens: rateLimitError.ChallengeTokens})
417+
c.JSON(429, SendMessageError{Msg: extendedError.Error(), ChallengeTokens: rateLimitError.ChallengeTokens})
418418
return
419419
} else {
420420
c.JSON(400, Error{Msg: err.Error()})

0 commit comments

Comments
 (0)