In my managed package I'm using a Post Install script to create and update some necessary data in customer orgs. This needs to happen without error otherwise some data integrity issues occur.

At first I did not have any try-catch in this script and I did get a failure on install but I didn't get any information as to the cause of the failure so I tried wrapping the code in a try-catch but this time the install did not fail even though the code failed and I threw my own exception upon catching the error.

Is there some other way of making sure that if I catch an error in my try-catch that the package installation does not go thru?

1 Answer 1


How about this approach: do a try/catch. In the catch, send an email with the caught error to yourself, so that you know the failure reason. Still in the catch throw an exception, so that the package install will fail.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .