tunnckoCore / express-better-ratelimit

Express.js request rate limiter
http://j.mp/1stW47C
Other
10 stars 0 forks source link

Is there an option to delegate limited/forbidden errors down the pipe? #7

Open sh505isau opened 9 years ago

sh505isau commented 9 years ago

I don't think there's a way to pass errors to Express' error handler at the moment.

Perhaps there could be an option like handleError: false that can be set to to allow Express to handle errors. And then in our error handler we could do something like...

if (err.code === 429) { // do something }
tunnckoCore commented 9 years ago

I'll review it tomorrow what I can do. But if something, it would be published in v2