[SalesForce] Server returned HTTP response code: 500

External third party service is occasionally getting Server returned HTTP response code: 500 when it does a POST to salesforce webservice class, but only occasionally. Most of the times it is working fine.

URL:https://domainurl/services/apexrest/classname . Here, domainurl is a public site url.Hence, whenever this webservice gets executed, it always gets executed by the same `Guest USER'

How can I debug such error especially when everything works out I am trying to post. AND Is there any way I can make a log in salesforce whenever such error is sent out?

Best Answer

As this seems to be a Lightning Platform error (see "status codes and error responses"), I'd definitely open a support case. Maybe you're lucky and they are able to log something. Be sure to tell them the time such an error occurred.

I had a hard time logging webservice communication in Salesforce as it basically doesn't exist (apart from Login Logs) and even the Support wasn't able to access anything useful apart from apex class logs.

Related Topic