B4J Question HTTPJOB Internal server error vs Log Error Message

ticasse

Member
Licensed User
Longtime User
Hi,

I'm using the HttpJob PostString and the xml is build at runtime. We may have sometime an error in an xml element that will raise an error (Job.Success = False). The Job.Message will contain "Internal server Error" but in the logs window I can see the detail error message.
Is it possible to retrieve/redirect the error that we see in the logs window ?

Thanks
A.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes. You will need to make a small modification to HttpUtils2Service.

B4X:
Sub hc_ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
   If Response <> Null Then
     Reason = Reason & CRLF & Response.ErrorResponse) '<----------
     Response.Release
   End If
   CompleteJob(TaskId, False, Reason)
End Sub
 
Upvote 0

ticasse

Member
Licensed User
Longtime User
Maybe I didn't found the right HttpUtils2Service source file but I had to put
B4X:
Reason = Reason & CRLF & Response.GetString("UTF8")
But at the end, it work fine.

Thanks Erel
A.
 
Upvote 0
Top