File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff 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}
78export interface ShowJSErrorElems {
89 actions : HTMLDivElement ;
Original file line number Diff line number Diff 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 ( ) ;
Original file line number Diff line number Diff line change 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 ( ) ;
You can’t perform that action at this time.
0 commit comments