Using okHttp & HttpUtils, today I called a php script and by mistake I forgot to return a result from the script.
So Job.Success was true but Job.GetString failed with "android.system.ErrnoException: open failed: ENOENT (No such file or directory)" which is "ok" -> Job was ok but there is no result.
Am I blind here? I don't see a way to handle this (except try/catch).
Of course it was my mistake (of course I return something from my php scripts at any time) but it took me some time to realize what the problem was as Job.Success was true but Job.GetString throwed an exception. To check the "problem" just call an empty php script which returns nothing.
Anyway: It would be great if Job.GetString will then return an empty string instead of throwing an exception (see above).
Sub Activity_Create(FirstTime As Boolean)
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.Download("https://link/you've/sent")
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Log($"Result: ${Job.GetString}"$)
Else
Log("Error: " & Job.ErrorMessage)
End If
Job.Release
End Sub