Hello,
I am sending a http request , if the request returns false I need to display a msgbox. PRoblem is this is what i get from the logs :
In my code I am trying to display the msgbox when the job's error message which is: "Account has insufficient balance for requested action."
job.errormessage is not the json for the error message it is empty
when I try job.getstring at success=false section as below ,it is not also working. How can i grab that message to show in msgbox ?
I am sending a http request , if the request returns false I need to display a msgbox. PRoblem is this is what i get from the logs :
B4X:
JobName = order, Success = false
{"code":-2010,"msg":"Account has insufficient balance for requested action."}
In my code I am trying to display the msgbox when the job's error message which is: "Account has insufficient balance for requested action."
job.errormessage is not the json for the error message it is empty
when I try job.getstring at success=false section as below ,it is not also working. How can i grab that message to show in msgbox ?
B4X:
If Job.JobName="order" Then
If Job.Success = True Then
Log(Job.GetString)
Else
Dim parser As JSONParser
parser.Initialize(job.getstring) ' I also tried job.errormessage here
Dim root As Map = parser.NextObject
Dim msg As String = root.Get("msg")
Dim code As Int = root.Get("code")
msgbox(msg,"Error")
End If
End If