@inversifyjs/core
Version:
InversifyJs core package
19 lines • 618 B
JavaScript
const isAppErrorSymbol = Symbol.for('@inversifyjs/core/InversifyCoreError');
export class InversifyCoreError extends Error {
[isAppErrorSymbol];
kind;
constructor(kind, message, options) {
super(message, options);
this[isAppErrorSymbol] = true;
this.kind = kind;
}
static is(value) {
return (typeof value === 'object' &&
value !== null &&
value[isAppErrorSymbol] === true);
}
static isErrorOfKind(value, kind) {
return InversifyCoreError.is(value) && value.kind === kind;
}
}
//# sourceMappingURL=InversifyCoreError.js.map