Μετάβαση στο περιεχόμενο
Από την έκδοση 0.5.0 τα πακέτα συνεχίζουν ως @cqrs-ddd, με τεκμηρίωση στο aristoteliss.github.io/ddd-cqrs· οι εφαρμογές NestJS προσθέτουν το @cqrs-ddd/nestjs. Αυτός ο ιστότοπος τεκμηριώνει τη σειρά 0.4.x.

RateLimitExceededFilter

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

Defined in: packages/pipeline-rate-limit/src/filters/rate-limit-exceeded.filter.ts:26

Catches RateLimitExceededError thrown by RateLimitBehavior at the pipeline boundary, mapping it to HTTP 429 Too Many Requests with a Retry-After header in seconds. It replies through Nest’s HTTP adapter, so it works on Express and Fastify, also for errors thrown in middleware.

Register it globally, so Nest injects the adapter host

@Module({ providers: [{ provide: APP_FILTER, useClass: RateLimitExceededFilter }] })
export class AppModule {}
  • ExceptionFilter

new RateLimitExceededFilter(adapterHost): RateLimitExceededFilter

Defined in: packages/pipeline-rate-limit/src/filters/rate-limit-exceeded.filter.ts:27

HttpAdapterHost

RateLimitExceededFilter

catch(exception, host): void

Defined in: packages/pipeline-rate-limit/src/filters/rate-limit-exceeded.filter.ts:31

Method to implement a custom exception filter.

RateLimitExceededError

the class of the exception being handled

ArgumentsHost

used to access an array of arguments for the in-flight request

void

ExceptionFilter.catch