File size: 393 Bytes
1fe7075
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.');