@worker-tools/deno-kv-storage
Version:
An implementation of the StorageArea (1,2,3) interface for Deno with an extensible system for supporting various database backends.
40 lines • 1.19 kB
JavaScript
export class ConnectionError extends Error {
constructor(message) {
super(message);
this.name = "ConnectionError";
}
}
export class ConnectionParamsError extends Error {
constructor(message) {
super(message);
this.name = "ConnectionParamsError";
}
}
export class PostgresError extends Error {
constructor(fields) {
super(fields.message);
Object.defineProperty(this, "fields", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.fields = fields;
this.name = "PostgresError";
}
}
// TODO
// Use error cause once it's added to JavaScript
export class TransactionError extends Error {
constructor(transaction_name, cause) {
super(`The transaction "${transaction_name}" has been aborted due to \`${cause}\`. Check the "cause" property to get more details`);
Object.defineProperty(this, "cause", {
enumerable: true,
configurable: true,
writable: true,
value: cause
});
this.name = "TransactionError";
}
}
//# sourceMappingURL=error.js.map