File tree Expand file tree Collapse file tree 3 files changed +262
-165
lines changed Expand file tree Collapse file tree 3 files changed +262
-165
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export class GlobalHandlers implements Integration {
9494 message . error && isString ( message . error . message ) ? message . error . message : 'No error message' ;
9595 }
9696
97- if ( stacktrace . mechanism === 'onunhandledrejection' && stacktrace . incomplete ) {
97+ if ( stacktrace . mechanism === 'onunhandledrejection' && ( stacktrace . incomplete || stacktrace . mode === 'failed' ) ) {
9898 return this . _eventFromIncompleteRejection ( stacktrace , error ) ;
9999 }
100100
@@ -166,8 +166,8 @@ export class GlobalHandlers implements Integration {
166166 if ( event . exception . values && event . exception . values [ 0 ] ) {
167167 event . exception . values [ 0 ] . mechanism = {
168168 data : {
169- incomplete : true ,
170169 mode : stacktrace . mode ,
170+ ...( stacktrace . incomplete && { incomplete : stacktrace . incomplete } ) ,
171171 ...( stacktrace . message && { message : stacktrace . message } ) ,
172172 ...( stacktrace . name && { name : stacktrace . name } ) ,
173173 } ,
Original file line number Diff line number Diff line change @@ -272,7 +272,12 @@ TraceKit._report = (function reportModuleWrapper() {
272272 * @see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
273273 */
274274 function _traceKitWindowOnUnhandledRejection ( e : any ) {
275- var err = e && typeof e . reason !== 'undefined' ? e . reason : e ;
275+ var err = e ;
276+ // You cannot itterate over non-objects, but we want to check
277+ // for the existence in any value, not for the value itself
278+ try {
279+ err = e && 'reason' in e ? e . reason : e ;
280+ } catch ( _oO ) { }
276281 var stack = TraceKit . _computeStackTrace ( err ) ;
277282 stack . mechanism = 'onunhandledrejection' ;
278283 _notifyHandlers ( stack , true , err ) ;
@@ -905,8 +910,8 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
905910
906911 return {
907912 original : ex ,
908- name : ex . name ,
909- message : ex . message ,
913+ name : ex && ex . name ,
914+ message : ex && ex . message ,
910915 mode : 'failed' ,
911916 } ;
912917 }
You can’t perform that action at this time.
0 commit comments