In our React Native project when capturing an exception in code that is executed in a callback after the RN bridge, the stack trace only goes as far back as when the message was pulled off the queue.
In the example below im using fetch to make an API request, ideally I’d like to be able to see the portion of the stack trace from before the message was actually placed on the queue (i.e. the code that lead up to the api request being made).
I’m wondering if this is an issue with my setup or a limitation of the react-native SDK.
Thanks!
-Dave
ApiError: Request failed with status code 401
File "app:///[native code]", in construct
File "node_modules/@babel/runtime/helpers/construct.js", line 30, col 21, in _construct
return _construct.apply(null, arguments);
File "node_modules/@babel/runtime/helpers/wrapNativeSuper.js", line 26, col 14, in Wrapper
return construct(Class, arguments, getPrototypeOf(this).constructor);
File "src/app/utils/api/ApiError.ts", line 14, col 5, in ApiError
super(message);
File "src/app/utils/api/index.ts", line 70, col 18, in fn
return new ApiError(e.message, response.status, response.data);
File "node_modules/promise/setimmediate/core.js", line 37, col 12, in tryCallOne
return fn(a);
File "node_modules/promise/setimmediate/core.js", line 123, col 15, in callback
var ret = tryCallOne(cb, self._55);
File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 146, col 7, in _callTimer
callback();
File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 194, col 7, in _callImmediatesPass
_callTimer(passImmediates[i], 0);
File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 458, col 12, in callImmediates
while (_callImmediatesPass()) {}
File "app:///[native code]", in callImmediates
File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 366, col 12, in __callImmediates
this._immediatesCallback();
File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 135, col 12, in fn
this.__callImmediates();
File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 343, col 9, in __guard
fn();
File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 134, col 10, in value
this.__guard(() => {
File "app:///[native code]", in value
File "app:///[native code]", in value