+ Start a Discussion
DCSDCS 

Handling webservice call out exception

I am doing a real time callout to a SAP webservice. If there is an error during the callout a friendly message is displayed to the user. We do not come to know about this error unless the user notifies us or it comes to the attention of people responsible for the external webservice.

 

I tried handling the exception at Apex side by inserting a record in  a custom Error object (which has built in workflow rules) or sending out email to the developers/administrators so that the developers/Admins are notified instantly.

 

But none of these(sending email or DML ) is not supported during a callout which is really bad. I hope there is a workaround to this. Has someone come across this ? If so how are you handling this.

gv007gv007

Use ApexPage error handing class to display error message at run time .

DCSDCS

That is how I am displaying message to the user. As a developer/admin, I want to know such a scenario other than getting a call from the user. I could not find a way to notify the developer/admin.