Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
I want to get return value from PostJSON when network disconnected
what is returned and how can I get value?
thank you
Solved! Go to Solution.
Hi kiyong park,
If there is any error in the custom code; system prints it in the script logs.
And I just tried it myself and got following error when there is no network:
JavaException: java.net.NoRouteToHostException: No route to host: connect
I used try/catch block to catch the error and wrote some code to do some stuff when this error occurs.
I hope it helps.
Hi kiyong park,
As per my understanding; the PostJSON will error out when there is no connection.
You can try to use a try catch block to handle that error.
I hope it helps.
Thank you Ankit
I have two more questions though I will try to use a try catch block.
Is not there any return value in internal system when error occur?
And Can't I treat PostJSON error value?
Hi kiyong park,
If there is any error in the custom code; system prints it in the script logs.
And I just tried it myself and got following error when there is no network:
JavaException: java.net.NoRouteToHostException: No route to host: connect
I used try/catch block to catch the error and wrote some code to do some stuff when this error occurs.
I hope it helps.
Thank you for your help.