NetTalk Central

Author Topic: NetWebServiceMethod - p_web.FileErrorCode() and p_web.FileError() not showing  (Read 4491 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Hi,

In the InsertRecord: routine, there is this line that is called when an insert error ocurred:

p_web.AddServiceError(Err,'dbRoleMember',p_web.RecordIdentifier(RoleMember), 'Error when attempting to Insert a record [' & p_web.ErrorCode() &'] ' & p_web.Error() & ' [' & [p_web.FileErrorCode() & '] ' & p_web.FileError(), '')

This is the JSON response describing the error:

{
    "dbRoleMember_response": {
        "queue": [
            {
                "ERRORNUMBER": 5,
                "ERRORPOSITION": "dbRoleMember",
                "ERRORRECORDID": "ROM_GUID=",
                "ERRORDESCRIPTION": "Error when attempting to Insert a record [90] File System Error",
                "ERRORRECOMMENDATION": ""
            }
        ]
    }
}


You will see that p_web.FileErrorCode() and p_web.FileError() does not show anything in the response - although it should have values because the database is PostgreSQL and I checked them individually and there are values. The square brackets in that same portion of code also don't show, so I think it could be a cstring issue with the return value of p_web.Error() that could include a terminating-0 character, and therefore the rest of the string is left blank.

Thanks
Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
My guess is the error descriptions are not being clipped. I've tweaked for the next build, but you can do the same in netweb.clw. Circa line 15707

NetWebServerWorkerBase.Error                  Procedure()!,String
  Code
  Return clip(self.LastError)
!------------------------------------------------------------------------------
...
!------------------------------------------------------------------------------
NetWebServerWorkerBase.FileError              Procedure()!,String
  Code
  Return clip(self.LastFileError)

Cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Thanks, it worked.