Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
'Log("Main.Jobdone("&Job.JobName&"), true")
'Log("JobName: "&Job.JobName&" / Response from server: " & Job.GetString)
Else
ToastMessageShow("Error: " & Job.ErrorMessage, True)
log($"Error: ${Job.ErrorMessage} "$)
End If
Job.Release
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
'Log("Main.Jobdone("&Job.JobName&"), true")
'Log("JobName: "&Job.JobName&" / Response from server: " & Job.GetString)
Else
ToastMessageShow("Error: " & Job.ErrorMessage, True)
log($"Error: ${Job.ErrorMessage} "$)
End If
Job.Release
It's really tough to help, since in the end we really only have the information that you are getting a internal server error. We have no code that shows what you are trying to GET/POST/WhoKnowsWhatElse to a server, nor do we have any idea of what the server expects (server API) or what the code is on the server side that may crap out. We don't even know if you are dealing with a issue of duplicate records, since we don't even know if any updates work (you've not told us/shown us any working code/sample data vs non-working code/sample data).
I think code is not neccesary. I only try to insert a record. If this record is duplicate, server sais to me "Internal Server Error". The question is how can i know that this server error is for duplicate entry and not for other reason. Do you know how to do it?
B4A log shows to me this issue, so i think that there is any way to detect it. See attached imagen.
If the server just throws a generic 500 code without explaining exactly why, then you're out of luck. Unless you have access to the source and then you could modify the response of the server
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
'Log("Main.Jobdone("&Job.JobName&"), true")
'Log("JobName: "&Job.JobName&" / Response from server: " & Job.GetString)
Else
ToastMessageShow("Error: " & Job.ErrorMessage, True)
log($"Error: ${Job.ErrorMessage} "$)
End If
Job.Release
so i expect the error he got is coming from the webapi he is calling (but i don´t know).
I think code is not neccesary. I only try to insert a record. If this record is duplicate, server sais to me "Internal Server Error". The question is how can i know that this server error is for duplicate entry and not for other reason. Do you know how to do it?
B4A log shows to me this issue, so i think that there is any way to detect it. See attached imagen.
If the server just throws a generic 500 code without explaining exactly why, then you're out of luck. Unless you have access to the source and then you could modify the response of the server
How are you getting these error messages/warnings? Where do they come from? Are these messages from the server?
I obtain this messages on the right of B4A IDE, i think that is a log, i can see "LogCat connected to: B4A-Bridge: Acer B1-730HD". I read that this a is the phone Log. LogCat is an object but i don't know hoy to read this message inside the app, any idea?
Post ALL relevant code which insert new items in the Database, post the full error if you ran into errors.
Based on the error i guess you are setting an value from the database which is an integer but which does not allowed to have multiple datasets with the same id. Are you trying to set the value by yourself?
I solve my problem with the "ON DUPLICATE KEY UPDATE statement".
I only need to know how to detect a duplicate record! Definition database es correct, i need this keys!
I think code is irrelevant. Database table definition is irrelevant. If a try to insert twice the same information, how can i know this situation by code??? Why B4A IDE can detect it?
That's just it. Without code we don't know why you are getting these log entries in B4A. If you were doing local SQL inserts, that may explain it, but since you are doing a HTTP request to update data, it does not seem to make sense.