a7ul / react-native-exception-handler

A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.
MIT License
1.58k stars 134 forks source link

smallbug: the callStack is lost in the exception.userInfo #64

Open fatfatson opened 6 years ago

fatfatson commented 6 years ago

https://github.com/master-atul/react-native-exception-handler/blob/f9175d2fd67c82c32bd2bca3a4e5cf3aa2ed8947/ios/ReactNativeExceptionHandler.m#L202

here the userInfo param should be the one above instead of a new created one.

fatfatson commented 6 years ago

another suggestion: why not put the raiseException function in this module. it's too annoyed to import another one for just a test function.

a7ul commented 6 years ago

For the userInfo loss. @fatfatson Can you raise a PR for the same ? raiseException is not meant to be used in a live project. Hence it will not be part of this module.

fatfatson commented 6 years ago

I have make a PR for bugfix. I still think putting the raiseExecption function here is convenient for all of us, the overload is trivial and much less than importing another module( manage, install, link ... )

a7ul commented 6 years ago

Hi @fatfatson Thank you for the PR. It looks good to me. But I don't believe that raise test native exception should be part of this module. The main reason being, it should never be in the production code. Hence, the decision to keep it as a separate module. By keeping it separate, we can quite easily remove it from the main react native code after testing the handler.