You need to sign in to do that
Don't have an account?
ChunWu
How to catch Exception from FutureHandler
I have a trigger which invokes a 'future' method in an Apex class.
The method with 'future' annotation looks like the following:
@future (callout=true) public static void updateDocument(Id claimId) { // do the web service callout }
Now if there is an exception thrown from this future method, it won't be caught by the calling trigger then no error message can be displayed to the end user. It looks like there is no error at all after 'Save'. But I still got email containing the exception and the debug log shows that the exception is thrown from the FutureHandler. How can I catch this exception in the trigger and display it on the page?
you can't throw exception to related page through future method because it is async call.
but still u can handle exception in code & send it to user through mail.