Skip to content

Commit 5d1a1a1

Browse files
committed
Levearge Ono to make exceptions serialiazable
1 parent 0b2a9d2 commit 5d1a1a1

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

lib/util/errors.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict";
22

3+
const { Ono } = require("ono");
4+
35
const { stripHash } = require("./url");
46

57
const GenericError = exports.GenericError = class GenericError extends Error {
@@ -9,6 +11,8 @@ const GenericError = exports.GenericError = class GenericError extends Error {
911
this.message = message;
1012
this.source = source;
1113
this.path = [];
14+
15+
Ono.extend(this);
1216
}
1317
};
1418

@@ -21,6 +25,8 @@ const GenericErrorGroup = exports.GenericErrorGroup = class GenericErrorGroup ex
2125
this._path = undefined;
2226
this._source = source;
2327
this.errors = errors;
28+
29+
Ono.extend(this);
2430
}
2531

2632
get source () {

package-lock.json

Lines changed: 20 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@
7070
},
7171
"dependencies": {
7272
"@stoplight/json": "^3.5.1",
73-
"@stoplight/yaml": "^3.5.1",
73+
"@stoplight/yaml": "^3.6.0",
7474
"call-me-maybe": "^1.0.1",
75-
"js-yaml": "^3.13.1",
76-
"ono": "^6.0.0"
75+
"ono": "^7.1.1"
7776
}
7877
}

0 commit comments

Comments
 (0)