Μετάβαση στο περιεχόμενο

httpAnswer

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

httpAnswer(error): HttpAnswer | undefined

Defined in: packages/nestjs/src/filters/http-exception.ts:145

The NestJS exception and headers for an error of a @cqrs-ddd package, or undefined for any other error. A ZodValidationError becomes the BadRequestException NestJS’s validation pipe throws (message lists the issues); a denied action, a disabled feature, an exceeded rate limit and an idempotency conflict take the status, body and headers their package’s toHttpResponse defines; a @cqrs-ddd/core domain error takes domainErrorHttpStatus. Every body has NestJS’s statusCode, message and error.

unknown

HttpAnswer | undefined

const answer = httpAnswer(new RateLimitExceededError(details));
answer?.exception.getStatus(); // 429
answer?.headers; // { 'Retry-After': '3' }