errors.ts 432 Bytes
Newer Older
1
import { IRI_PROPERTY } from './index';
Guillaume Perréal's avatar
Guillaume Perréal committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15

export class APICacheError extends Error {}

export class MissingIRIError extends APICacheError {
    public constructor() {
        super(`resource must have an ${IRI_PROPERTY} property`);
    }
}

export class IRIMismatchError extends APICacheError {
    public constructor(expected: string, actual: string) {
        super(`${IRI_PROPERTY}s mismatch: ${actual} !== ${expected}`);
    }
}