Skip to content

Commit b783954

Browse files
committed
feat: add isCache flag to CoreError
1 parent 5452e1d commit b783954

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/CoreError.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CoreError extends Boom {
1616
constructor(message, options) {
1717
options = Object.assign({}, options);
1818

19-
const { ctr = CoreError, isInternal = false } = options;
19+
const { ctr = CoreError, isInternal = false, isCache = false } = options;
2020
if (message && !message.isBoom && message instanceof Error) {
2121
message.name = `${CoreError.name} - ${message.name}`;
2222
}
@@ -34,6 +34,7 @@ class CoreError extends Boom {
3434
this.status = this.output.statusCode;
3535
this.typeof = ctr;
3636
this.isInternal = isInternal;
37+
this.isCache = isCache;
3738

3839
return this;
3940
}
@@ -61,7 +62,8 @@ class CoreError extends Boom {
6162

6263
static CachedNotFound() {
6364
return this.notFound(this.CachedNotFound.name, {
64-
ctr: this.CachedNotFound
65+
ctr: this.CachedNotFound,
66+
isCache: true
6567
});
6668
}
6769

0 commit comments

Comments
 (0)