Added static method for creating PawSQLiteErrors from other errors
This commit is contained in:
parent
38df7f1053
commit
7b9095ffa6
@ -1,4 +1,10 @@
|
|||||||
export class PawSQLiteError extends Error {
|
export class PawSQLiteError extends Error {
|
||||||
|
static from(err) {
|
||||||
|
const p_err = new PawSQLiteError(err.toString());
|
||||||
|
p_err.cause = err;
|
||||||
|
return p_err;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(message) {
|
constructor(message) {
|
||||||
super(message);
|
super(message);
|
||||||
this.name = "PawSQLiteError";
|
this.name = "PawSQLiteError";
|
||||||
|
Loading…
Reference in New Issue
Block a user