How to get statusCode from the ${response} for connector in camunda

Hi all,
I have a connector implemented in my SEND TASK , where it is connected to a java method
public int connectorApi(HttpServletResponse response, HttpServletRequest request)

, now in my bpmn i have given the ASYN AFTER on the SEND TASK.

Now if i try to give a wrong URL it throws an error and the response comes as
{“status”:“Not Found”,“message”:“No message available”,“statusCode”:404}

and the (red)token stays at the SEND TASK ,which is not needed,
if the error comes, it should rather stay at the previous task.

Is there any way, that i can pass response as json, and parse the json to compare statusCode==200 in the gateway.

The BPMN is attached below.

code.bpmn (10.7 KB)