Android Question RemoteServerClient SQL ERROR LOG Message !

alienhunter

Active Member
Licensed User
Longtime User
Hi to all

does anyone know how to catch this message and evaluate ?
please see jpg

thanks AH
 

Attachments

  • sqlerror.jpg
    sqlerror.jpg
    15.1 KB · Views: 195

alienhunter

Active Member
Licensed User
Longtime User
The three columns specified in the message should be unique. How did you create the table? Which query is failing?

Hi Erel ,

the query is working like it should and the RDC too but how I can catch that sql error/message to pass the information to the user , because in the jobdone sub from the RDC it is just logging "error = server error " in this case . My problem is how should i let the user know he is trying to create a duplicate ....
I dont know from where that sql message comes from ... can't find it must be from the server side ? or i missed something ?

thanks AH
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
I see. The error message will be available in Job.ErrorMessage.



Sorry to bug you but the only message that works is from apache ..
hmmmm


B4X:
Log("SAVE " & saver)
    If job.Success = False Then

    If job.ErrorMessage.Contains("org.apache.http.conn.ConnectTimeoutException:")= True Then
        ToastMessageShow("FAIL TO CONNECT TO DATABASE", True)
    End If

    If job.ErrorMessage.Contains("java.sql.SQLException: [SQLITE_CONSTRAINT]") =True Then
        Log ("HERE")
    End If
Log("Error: " & job.ErrorMessage)


Logs

java.sql.SQLException: [SQLITE_CONSTRAINT]  Abort due to constraint violation (columns jobnr, part, setup, mach are not unique)
SAVE 0
Error: Server Error

thanks AH
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
Not sure that I understand. Did you find the error message?

Hi Erel ,

sorry for my post (..)
so my problem is i cannot give the user a message what is happening in my
RemoteServerClient

example :
[SQLITE_CONSTRAINT] Abort due to constraint violation

because in the sub JobDone there is only job.ErrorMessage for logging the errors
(that i could find ..)


B4X:
Log("Error: " & job.ErrorMessage)


now this "job.ErrorMessage" does not return any SQL errors only "Error: Server Error" what is not
really helpful what is wrong with the SQL


Now my other question is , in the Logs there is a SQL message

java.sql.SQLException: [SQLITE_CONSTRAINT] Abort due to constraint violation (columns jobnr, part, setup, mach are not unique)
but i cannot find from
where this comes from and how to catch the message
to be able to notify the user what is wrong


thanks Alfred
 

Attachments

  • log2.jpg
    log2.jpg
    37 KB · Views: 170
Last edited:
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
Remove the reference to HttpUtils2 library and add the two code modules of HttpUtils2 (HttpJob and HttpUtils2Service). You will see where the full error message is logged.

thank you very much I will give it a try and let you know , otherwise the
RDC concept is working excellent will test it in a large company ..

thanks Alfred
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
thanks Erel
i found my SQL error message
Alfred


B4X:
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
    If Response <> Null Then
        Try
            Log("HERE SQL ERROR "& Response.GetString("UTF8"))
        Catch
            Log("Failed to read error message.")
        End Try
        Response.Release
    End If
    CompleteJob(TaskId, False, Reason)
End Sub
 
Upvote 0
Top