Files
mtusi2026lab3/src/Auth/auth.exception.ts
T
qrtx 24f32c3fbe feat(api): implement persistent messaging and graceful draining
Add shared sessions, cached message history and transactional idempotency backed by PostgreSQL. Return readiness 503 during draining and finish in-flight requests before closing dependencies.
2026-10-29 11:46:28 +03:00

19 lines
538 B
TypeScript

import { HttpStatus } from '@nestjs/common';
import { ApiException } from '../common/exceptions/api.exception';
export class AuthException extends ApiException {
readonly challenge: string;
constructor(scheme: 'Basic' | 'Bearer') {
super(
HttpStatus.UNAUTHORIZED,
'unauthorized',
'Требуется действительная аутентификация',
);
this.challenge =
scheme === 'Basic'
? 'Basic realm="messenger", charset="UTF-8"'
: 'Bearer realm="messenger"';
}
}