Skip to content

Commit 94b3502

Browse files
committed
Implement internalData property
1 parent 106ec8f commit 94b3502

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface ErrorConfig {
88
message: string;
99
time_thrown?: string;
1010
data?: object;
11+
internalData?: object;
1112
options?: {
1213
showPath?: boolean;
1314
showLocations?: boolean;

test/spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,18 @@ describe('formatError', () => {
137137
});
138138
});
139139
});
140+
context('error has internalData', () => {
141+
it('does not include the internalData property', () => {
142+
const FooError = createError('FooError', {
143+
message: 'A foo error has occurred',
144+
internalData: {
145+
secret: 'SQL ERROR'
146+
}
147+
});
148+
149+
const e = new FooError();
150+
const s = formatError(e);
151+
expect(s.internalData).to.eq(undefined)
152+
})
153+
})
140154
});

0 commit comments

Comments
 (0)