B4J Question Httputils2 read timed out

billmoultrie

Member
Licensed User
Longtime User
I get a java message that says : java.net.SocketTimeoutException: Read timed out
This is correct as the IP address is not available.
But is it possible to catch this message rather than just have a Java error. Like
'If Job.Success Then'
 

billmoultrie

Member
Licensed User
Longtime User
Thanks.
The top of JobDone is:

B4X:
Sub JobDone(Job As HttpJob)
    Log("Job done ")
   
    If Job.ErrorMessage Then
        Log(Job.ErrorMessage)
    End If
   
    If Job.Success Then
        Log(Job.GetString)

    Else
        Log(Job.ErrorMessage)
    End If
The java error message is coming before entering this code, so it could be in HTTPutils2.
The message is: java.net.SocketTimeoutException: Read timed out
After 'jobdone' I get the java error message/
java.lang.RuntimeException: Cannot parse: java.net.SocketTimeoutException: Read timed out as Boolean
 
Upvote 0

billmoultrie

Member
Licensed User
Longtime User
Of course you are right.
I have realized that the java error does not matter.
I can capture the error message and act on it.
In B4A an error message would have stopped the program.
 
Upvote 0
Top