-
Notifications
You must be signed in to change notification settings - Fork 43
Exception thrown when rate limit exceeded #1
Comments
Sorry for the delayed response, somehow I missed this notification entirely. I'll take a look at your suggestion and get back to you :) |
So I've taken a look and tried both your suggestions, and I cannot get it to work. The exception is thrown and the logger picks it up, but the resulting http response is just a 500 error. My experience with Typescript and NestJS is fairly new, so I'll keep looking into this. There's surely something I'm doing incorrectly, so I'll keep hacking away at this. |
From the docs:
{
"statusCode": 500,
"message": "Internal server error"
} I'm not sure though if this counts for interceptors after you eject to an http context. |
|
I'm having the same issue. Getting this error message when the limit has been reached.
@edongashi By any chance did you manage to find a way to solve this? |
@d30jeff I'm not sure. I think after configuring and testing in swagger it showed 429 properly. I have to test it again though because I haven't used this in production yet. |
Sorry for late response. Don't remember every detail when I was debugging nestjs framework, however if you go check nestjs internal implementation for handling errors, its implemented in a way that every error that is instance of HttpException should return response with the message and status code that you provided, and if its not framework will return 500 and internal service error message (https://github.com/nestjs/nest/blob/master/packages/core/exceptions/base-exception-filter.ts#L29). Since we are creating an instance of HttpException Didn't have time to debug this issue any further so I handled the issue by creating my own exception filter (something similar to https://github.com/nestjs/nest/blob/master/sample/01-cats-app/src/common/filters/http-exception.filter.ts), but how you'll handle catching those errors depends on the requirements you'll have. Hope this helps. |
@RyanTheAllmighty #10 fixed the issue for us as well, but the PR is closed right now. Could you reconsider merging it and releasing a new version? |
Issue has been fixed with 011d418 |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm getting exception thrown when rate limiter is exceeded.
I'm using:
As far as I can see, error happens in this catch block.
I would suggest either to return an observable after response has been sent or replace this with:
Waiting on your response.
The text was updated successfully, but these errors were encountered: