How can I get PostJSON return value when network diconnected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How can I get PostJSON return value when network diconnected
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for your help.