I know this has been discussed before but all of the threads are several years old. I couldn't find a finite answer and also I am trying to find out if anything has changed since.
I am trying to figure out what is the best way to handle exceptions in a managed package where I can notify myself about them without the customer having to take action. In other words be proactive rather than reactive.
Ideally what I am looking for is the getMessage()
and getStackTrace()
methods on the Exception class.
I've been browsing through SE and it appears it won't be as straight forward as writing apex code in your own org.
Errors within managed packages are suppressed. You will need to raise a case with SF to get the logging turned on for managed packages. They will only enable the logging for a certain amount of time.
We have the error stack traces stored into a custom object, but even using the subscribers tab log in doesn't unmask the stacktrace; just says (namespace).
As of right now has any of this changed? Is it possible to capture the stack trace and store it in a custom object/email it to myself/store it to an external API?
What do you guys do with your managed packages in order to debug any errors?
As a last resort - if I throw an error can the user in the org see the stack trace and perhaps provide it to me?