Bug? Error not returned to the program in HttpUtils2Service

Informatix

Expert
Licensed User
Longtime User
In a project using a MySQL db, Job.ErrorMessage always returns "Internal server error" whatever error occurs on the DB side so I cannot do anything with it. It's because, in HttpUtils2Service, the ErrorResponse is sent to the log, and not returned to the program!
 

Informatix

Expert
Licensed User
Longtime User
Here's my change:
B4X:
Sub hc_ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
    Dim ErrMsg As String = Reason
    If Response <> Null Then
        ErrMsg = ErrMsg & CRLF & Response.ErrorResponse
        Log(Response.ErrorResponse.Replace("\n", CRLF))
        Response.Release
    End If
    CompleteJob(TaskId, False, ErrMsg)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…