f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/js/common/errors/StandardError.ts
-rw-r--r--
584
 1import { StatusName } from "./StatusName";
 2
 3export interface StandardError {
 4  code: number;
 5  status: number;
 6  message: string;
 7  name: StatusName;
 8}
 9
10/**
11 * Abstract constructor to help with creation of all other errors.
12 */
13export abstract class AbstractStandardError extends Error implements StandardError {
14  code: number;
15  status: number;
16  message: string;
17  name: StatusName;
18
19  protected constructor(code: number, message: string, name: StatusName) {
20    super(message);
21    this.message = message;
22    this.code = code;
23    this.status = code;
24    this.name = name;
25  }
26}