~sirn/fanboi2

ref: a68873a108d20a6a49a1b6caf374bfb2cf6a94fe fanboi2/assets/app/javascripts/utils/errors.ts -rw-r--r-- 528 bytes
a68873a1Kridsada Thanabulpong Coding style cleanups and setup pre-commit hooks (#42) 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export interface Error {
    name: string;
    message: string;
    object?: any;
}

export class NotImplementedError implements Error {
    public name = "NotImplementedError";

    constructor(
        public message: string = "The method was called but not implemented.",
        public object?: any,
    ) {}
}

export class ResourceError implements Error {
    public name = "ResourceError";

    constructor(
        public message: string = "The resource could not be retrieved.",
        public object?: any,
    ) {}
}