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
Abilash.SAbilash.S 

How to catch exception in continuation call

Hi Everyone,
I am doing continuation call for long running calls and bulk loads processing. In continuation call, there will be three parallel calls at a time. I need to catch exceptions happened in three calls if response is failure.
For example, One call has exception, second call has success, third call has exception. So first call and third call has exception. I need to consolidate two exceptions at a place and handle those exceptions and store in object with DML operation. 
What I knew that once exception raised I can do DML after that the call shouold continue it should not effect remaining calls. How Cani approach.
 Continuation con = new Continuation(100); // 1 call---exp , 2 call sucess, 3 -exp. dml
        con.ContinuationMethod = 'processResponse';
        string endpointurl = EndPoint;
        endpointurl= endpointurl+portalids;
        //Object strResponse;
        Http httpHandler = new Http();
        HttpRequest req = new HttpRequest();
        
            req.setMethod('GET');
            req.setEndpoint(endpointurl);
            req.setTimeout(120000);
            req.setHeader('content-type', 'application/json');
            req.setHeader('Accept', 'application/json');
            req.setHeader('Authorization','OAuth '+accessToken);
            req.setHeader('Authorization','Bearer '+accessToken);
            con.addHttpRequest(req);
            HttpResponse response = httpHandler.send(req);
if(response?.getStatusCode() == 200)  //If Reponse successful..
            {  hanlde success call
} else { //if reponse fails
store exceptions
}

Can I use if else condition for to check response success or failure. I am using continuation call. In this call 3 calls will happen at a time. If I get two failures in two calls can I catch in else loop??
Am I going to right approach Please help.