7
    public class TestEx{
  try{
    //some code
  }catch(Exception e){
    string errmsg='';
    errmsg+=e.getmessage();
    errmsg+='\n';
    errmsg+=e.getCause();
    errmsg+='\n';
    errmsg+=e.getLineNumber();
    errmsg+='\n';
    errmsg+=e.getStackTraceString();
    log__c log= new log__c();
    log.Name='SomeName';
    log.Error_Log__c=errmsg;//long text
    insert log;
  }

}

when this code is executed in a developer org of a managed pkg, the result is as expected. But after releasing this code when this code is executed in installed org,All the methods are returning null except the getmessage() method.

1
  • Im pretty sure that is the expected behaviour. 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.
    – BarCotter
    Apr 17 '14 at 14:07
7

If the package has passed security review, then the org the package is installed in can grant you login access like they would to Salesforce Support. This enables you to login via the Subscriber Tab in your LMA org to that org - and at that point, when you look in the Dev Console, you'll see the stack trace.

7
  • Is passing security review required? Mar 19 at 19:35
  • 1
    Yes - it has to pass security review, and then have a license record in your LMA that can be used to access the subscriber console Mar 19 at 19:59
  • 1
    I guess it is more accurate to say the publisher needs to have been approved by SF and have an app that has passed security review, and have the LMA installed and linked to the package. With the LMA installed, you can't login, and you don't get that until you have been approved as a partner, including having an app that has passed. More info here: zachelrath.wordpress.com/2013/01/17/… Mar 19 at 20:29
  • 1
    Also try hitting up Vivek on Twitter - he's your guy for these question: twitter.com/VivekMChawla Mar 19 at 20:35
  • 1
    Sweet, that helps a ton. I owe you a beer next time i'm in DC Mar 19 at 20:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.