mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
24 lines
570 B
JavaScript
24 lines
570 B
JavaScript
//#region src/core/errors.ts
|
|
var StoreError = class extends Error {
|
|
code;
|
|
cause;
|
|
constructor(code, options) {
|
|
super(options?.message ?? code);
|
|
this.name = "StoreError";
|
|
this.code = code;
|
|
this.cause = options?.cause;
|
|
}
|
|
};
|
|
function isStoreError(error) {
|
|
return error instanceof StoreError;
|
|
}
|
|
function throwNoTargetError() {
|
|
throw new StoreError("NO_TARGET");
|
|
}
|
|
function throwDestroyedError() {
|
|
throw new StoreError("DESTROYED");
|
|
}
|
|
//#endregion
|
|
export { StoreError, isStoreError, throwDestroyedError, throwNoTargetError };
|
|
|
|
//# sourceMappingURL=errors.js.map
|