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.');