Bugsnag and Unity... stack trace issue

I am integrating bugsnag for my project and I’m encountering some inconsistencies with the stack traces for thrown exception. Given the following code…

            Bugsnag.Notify(new Exception("Manually reporting exception from main thread"));
            throw new NullReferenceException("Throwing exception from main thread");

manually reporting the error via Bugsnag.Notify() reports a proper stack trace, while throwing an exception loses all but the method from which it is called…

To add to the mystery, if I throw an exception from a thread, I do get a proper stack trace.

Has anyone encountering this issue? Solution?
Thx in advance :smile:

@cpuRunningHot I am experiencing the same issue and considering wrapping parts of my code with try blocks, but given that Unity controls most of the input paths (to Start/Update, etc), this seems like an exercise in futility.

I’d love to know if you have come up with a better solution since September?

I’ve since put it to the back of my mind. I do remember trying a few different techniques, one of which was to set autoNotify to false, and manually process the exceptions via Bugsnag.Notify().

I think I settled on a strategy of catching as many exceptions as I can and manually processing them, but leaving the autoNotify on so it will catch all others. A very unsatisfactory solution, but I had to move on. If you come up with a solution, please let me know ( as will I/you when I revisit the topic )