Browse Source

Added static method for creating PawSQLiteErrors from other errors

master
Ben Ashton 3 years ago
parent
commit
7b9095ffa6
  1. 6
      src/pawsqlite_error.mjs

6
src/pawsqlite_error.mjs

@ -1,4 +1,10 @@
export class PawSQLiteError extends Error {
static from(err) {
const p_err = new PawSQLiteError(err.toString());
p_err.cause = err;
return p_err;
}
constructor(message) {
super(message);
this.name = "PawSQLiteError";

Loading…
Cancel
Save