Skip to content

Commit 26904c5

Browse files
committed
🌀
1 parent 6f14096 commit 26904c5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

dist/ShowJSError.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export interface ShowJSErrorSettings {
33
reportUrl?: string;
44
templateDetailedMessage?: string;
55
size?: 'big' | 'normal';
6+
errorFilter?: (error: ExtendedError) => boolean;
67
}
78
export interface ShowJSErrorElems {
89
actions: HTMLDivElement;

dist/show-js-error.esm.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,13 @@ var ShowJSError = /** @class */ (function () {
212212
size: settings.size || 'normal',
213213
reportUrl: settings.reportUrl || '',
214214
templateDetailedMessage: settings.templateDetailedMessage || '',
215+
errorFilter: settings.errorFilter || function () { return true; },
215216
};
216217
};
217218
ShowJSError.prototype.pushError = function (error) {
219+
if (!this.settings.errorFilter(error)) {
220+
return;
221+
}
218222
this.state.errorBuffer.push(error);
219223
this.state.errorIndex = this.state.errorBuffer.length - 1;
220224
this.updateUI();

dist/show-js-error.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,13 @@
215215
size: settings.size || 'normal',
216216
reportUrl: settings.reportUrl || '',
217217
templateDetailedMessage: settings.templateDetailedMessage || '',
218+
errorFilter: settings.errorFilter || function () { return true; },
218219
};
219220
};
220221
ShowJSError.prototype.pushError = function (error) {
222+
if (!this.settings.errorFilter(error)) {
223+
return;
224+
}
221225
this.state.errorBuffer.push(error);
222226
this.state.errorIndex = this.state.errorBuffer.length - 1;
223227
this.updateUI();

0 commit comments

Comments
 (0)