3

First of all, my question is very similar to this one and might actually be a duplicate, however there is no notion of a managed package or debug logs there.

We have an after insert trigger on Account doing something like:

    try{
        //some code that will cause a DMLException
    } catch (Exception e) {
        Exception_Log__c el = new Exception_Log__c();
        el.Stack_Trace_String__c = e.getStackTraceString();
        el.Message__c = e.getMessage();
        el.Line_Number__c = e.getLineNumber();
        el.Type_Name__c = e.getTypeName();
        insert el;             
    }

Additionally, we have an installed managed package that has an Account trigger that will also fire.

We get this result when the code executes:

enter image description here

When I turn on debug logs for my user

enter image description here

and execute the code again, I get this result:

enter image description here

So it seems the stack trace is being wiped out if somewhere in the execution we have passed through managed code, and only if we are not generating debug logs? We understand the stack trace has no info when the exception is generated from the managed package for IP reasons, but why are we not able to see the stack trace when it is generated from our own code and how can we work around this?

  • 1
    does this KA help? Quote: When the managed package debug Logs are enabled, you can see the complete stack trace in results – Novarg Jan 17 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.