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
IanDoneganIanDonegan 

Allow apex execution to continue if there is an unauthorized endpoint?

Hello All,

We have an apex class that makes an http callout to endpoints returned by a soql query. Right now, if one of the returned endpoints does not have a Remote Site entry, the entire scheduled job fails. If there is one error, everything stops.

Is there a way to do either of these things:

1. Verify that there is a valid remote site entry for each endpoint before making the callout, so as to prevent these errors

2. Allow the execution to continue after encountering this kind of error, allowing the "approved" callouts

Thank you, to all respondants.
Best Answer chosen by IanDonegan
IanDoneganIanDonegan
Never mind. I was able continue execution by putting the callout in a try/catch statement.