function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jared Jacob 10Jared Jacob 10 

how to debug errors from external service

I have created my first couple of external services but I am having issues trying to figure out how to capture error responses from the API I am calling. I have registered my external service, setup my named credential, and made sure salesforce had the url setup in remote sites. I setup a flow to call the generated apex class from my swagger json definition and it works great, when the API returns a successful HTTP 200 status.

Currently one of my services is not working and I can't get anymore information. My guess is the endpoint is not reachable based on my companies firewall but the only message I get when I run debug in flow is below.

Error Occurred: Callout failed: null

TLDR: Where or How can I see the actual response or status from the external service call? Let me know if there are any other details you need me to provide, I am still fairly new to SF dev.
Best Answer chosen by Jared Jacob 10
VinayVinay (Salesforce Developers) 
Hi Jared,

You can enable debug logs and check for more information.

Setup > Administration Setup > Monitoring > Debug Logs.

https://help.salesforce.com/articleView?id=code_debug_log.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Jared,

You can enable debug logs and check for more information.

Setup > Administration Setup > Monitoring > Debug Logs.

https://help.salesforce.com/articleView?id=code_debug_log.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer
Jared Jacob 10Jared Jacob 10

I did try setting that up setting the callout debug level with callout being set to finest. I still am only seeing that message that is callout failed null. I am guessing that is the best detail I am able to find then. I would think I would see at least 404 somewhere if it couldn't resolve the url.

Is it possible to just run the generated apex from the external service on its own or even look at the code behind it? Right now I only know how to test it by adding the action to a flow. Maybe that will help get me more details.

Thanks for the help.