Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have a use case where tRestClient hits an API and if error generated then it should catch the error and next sub job should not be affected for execution. But unfortunately the job is getting terminated.
I Also tried one other scenario where I have unselect the checkbox "DIE ON ERROR
"
in tRestClient in that case the sub job is working fine but no error catch happening in tDie which is connected ON ERROR of tRestClient.Please guide me
Thanks in advance.
Hello kuwaryogi27,
do you really need tDie ? Maybe tWarn will be better? Try to replace it with Die on error checked in tRestClient.
Hello kuwaryogi27,
do you really need tDie ? Maybe tWarn will be better? Try to replace it with Die on error checked in tRestClient.
It provides a <null> status code when a 200 is given and a valid status code when anything other than 200 is given.
Your row errors are perfectly fine no exception is raised. so after youve done add java component and in java code Throw Exception() or something like that. Google for some correct proper code.
Hello @Kamil Kowalczyk ,
Yes this worked for me, Thank you for your guidance.
Screenshot of design:
Hello @Jesper van ,
Yes your guidance worked for me what I implemented from you comment is in below screenshot,
I was not able to handle java.net.SocketTimeoutException: SocketTimeoutException
eg: In tRestClient when Die on error checkbox is selected the job was getting terminated without the exception getting caught in tWarn so parallel to it I used tRestClient -> On component error -> tJava
In tJava fetched the exception raised by tRestClient ((String)globalMap.get("tRESTClient_1_ERROR_MESSAGE")) and on component ok connected to next subjob.
But one concern over here as you can see in screenshot the first job is not terminated how can I resolve that.
Thank you for your guidance, waiting for your response for my above concern.
Thanks in advance.
Hello @Kamil Kowalczyk ,
tWarn is not handling the socket timeout exception. Is there some way to handle it I want the next subjob to work. In below comment in this same thread mentioning you what I did for this but have one concern the first subjob did not ended and job got disconnected on successful completion of below connected subjob.
I'm not sure if it's what you want, but try to use OnComponentOK between tJava_4 and tChronometerStop_* . Make sure that this connection is the first one (order 1). Then do OnComponentOk between tJava_4 and tChronometerStart_2.
Hello @Kamil Kowalczyk ,
I did this but the response was same, it displays Starting on further flow(tMap_7 and further)
But anyways this is not stopping our work.
Thanks for your valuable time and comment.
Hi kuwaryogi27,
I think I know how to do this. This behaviour is normal for this component - the Response is always (good or bad). To stop the response flow, you have to use RunIf link somewhere after tMap7 (I don't know what is happening inside next components), and write some condition based on statusCode. Please try, and let me know 🙂