File tree 4 files changed +264
-165
lines changed 4 files changed +264
-165
lines changed Original file line number Diff line number Diff line change 3
3
## Unreleased
4
4
5
5
- [ browser] feat: Use framesToPop for InvaliantViolations in React errors (#2204 )
6
+ - [ browser] fix: Make sure that falsy values are captured in unhandledrejections (#2207 )
7
+ - [ loader] fix: Loader should also retrigger falsy values as errors (#2207 )
6
8
7
9
## 5.6.1
8
10
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export class GlobalHandlers implements Integration {
94
94
message . error && isString ( message . error . message ) ? message . error . message : 'No error message' ;
95
95
}
96
96
97
- if ( stacktrace . mechanism === 'onunhandledrejection' && stacktrace . incomplete ) {
97
+ if ( stacktrace . mechanism === 'onunhandledrejection' && ( stacktrace . incomplete || stacktrace . mode === 'failed' ) ) {
98
98
return this . _eventFromIncompleteRejection ( stacktrace , error ) ;
99
99
}
100
100
@@ -166,8 +166,8 @@ export class GlobalHandlers implements Integration {
166
166
if ( event . exception . values && event . exception . values [ 0 ] ) {
167
167
event . exception . values [ 0 ] . mechanism = {
168
168
data : {
169
- incomplete : true ,
170
169
mode : stacktrace . mode ,
170
+ ...( stacktrace . incomplete && { incomplete : stacktrace . incomplete } ) ,
171
171
...( stacktrace . message && { message : stacktrace . message } ) ,
172
172
...( stacktrace . name && { name : stacktrace . name } ) ,
173
173
} ,
Original file line number Diff line number Diff line change @@ -272,7 +272,12 @@ TraceKit._report = (function reportModuleWrapper() {
272
272
* @see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
273
273
*/
274
274
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 ) { }
276
281
var stack = TraceKit . _computeStackTrace ( err ) ;
277
282
stack . mechanism = 'onunhandledrejection' ;
278
283
_notifyHandlers ( stack , true , err ) ;
@@ -906,8 +911,8 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
906
911
907
912
return {
908
913
original : ex ,
909
- name : ex . name ,
910
- message : ex . message ,
914
+ name : ex && ex . name ,
915
+ message : ex && ex . message ,
911
916
mode : 'failed' ,
912
917
} ;
913
918
}
You can’t perform that action at this time.
0 commit comments