prevision / apps /prevision-api /src /common /exceptions /app.exception.ts
github-actions[bot]
Automated Deploy: 23110475c742a5d4f03930b55bca09042215c1dd
1fe7075
Raw History Blame Contribute Delete
393 Bytes
import { HttpException } from '@nestjs/common';
/** An error with a stable code the frontend can act on. */
export class AppException extends HttpException {
constructor(
status: number,
readonly code: string,
message: string,
) {
super(message, status);
}
}
export const unauthenticated = () => new AppException(401, 'UNAUTHENTICATED', 'Please sign in to continue.');