Last updated: 2024-06-07
Error Handling
In this topic:
Overview
This topic describes errors you may encounter when sending requests to SmartIntegrator.
Status Element
The _status element at the end of an XML response indicates whether SmartIntegrator encountered an error processing a request.
- A status of
OKmeans no error occurred. - A status of
errormeans at least one error occurred. Information about the error is included in theerrorelement in the response.
Error Element
The error element in a response XML contains the error code and description. Here is an example of an invalid search operation request:
<request version="1.0">
<header>
<office/>
<user/>
<password/>
<keepsession>true</keepsession>
</header>
<search total="true" pagesize="3">
<object>
<Contact>
<LastName/>
<FirstName/>
</Contact1>
</object>
<condition>
<expr prop='LastName' op='starts'>
<v>A</v>
</expr>
</condition>
</search>
</request>The typo in the closing tag for the Contact element generates the following error response:
<response version="1.0">
<header>
<sessionClosed/>
</header>
<error code="1001">Invalid XML format. The end-tag for element type "Contact" must end with a '>' delimiter.</error>
</response>Clients must parse the entire response to find out if an error occurred.
Error Behavior
There are two types of errors that SmartIntegrator returns:
- System errors are internal errors caused by existing issues or the environment. When this happens, the stack trace is printed out.
- Process errors are caused by ill-formed request XML.
Error codes 2001, 2002 and 2003 denote login and session errors. The process is aborted if one of those errors occurs.
Error 1001 is an XML syntax error that also stops processing.
All other errors produce an error element generated inside the element that caused the error, but SmartIntegrator continues to process the rest of the request. All unfinished operations in a transaction element are canceled if an error happens inside the transaction.
The following example shows the different error behavior inside and outside of a transaction. Here is the request:
<request version="1.0">
<header>...</header>
<transaction>
<get>
<Contact id="Contact.">
<FullName/>
</Contact>
</get>
<get>
<Contact id="Contact.65854.3">
<FullName/>
</Contact>
</get>
</transaction>
<get>
<Contact id="Contact.">
<FullName/>
</Contact>
</get>
<get>
<Contact id="Contact.65854.3">
<FullName/>
</Contact>
</get>
</request>The response shows that the error inside the transaction element caused all of the get requests in that transaction to error, while the valid get request that was not part of the transaction was processed:
<response version="1.0">
<header>...</header>
<transaction>
<get>
<Contact id="Contact." _status="error">
<error code="3004">Invalid Object Id.</error>
</Contact>
</get>
</transaction>
<get>
<Contact id="Contact." _status="error">
<error code="3004">Invalid Object Id.</error>
</Contact>
</get>
<get>
<Contact id="Contact.65854.3">
<FullName>Ackerman, Joseph</FullName>
</Contact>
</get>
<_status>error</_status>
</response>Error Code List
| Code | Symbol | Message |
|---|---|---|
| System Errors | ||
| 1 | ERROR_SYSTEM | Internal error. |
| 2 | ERROR_ILLEGEL_ARGUMENT | Illegal Argument Exception. %1 |
| 3 | ERROR_INVALID_DATA_TYPE | Invalid data type %1. |
| 4 | ERROR_UNSUPPORTED_TYPE | Unsupported type %1. |
| 5 | ERROR_FAILED_TO_CREATE_OBJECTID | Failed to create object ID ( %1 ). |
| 6 | ERROR_MISMATCH_OBJECTID | Object ID ( %1 ) does not match with object ( %2 ). |
| XML Errors | ||
| 1001 | ERROR_XML_INVALID_FORMAT | Invalid XML format. |
| 1002 | ERROR_XML_INVALID_TAG_NAME | Invalid Tag name ( <%1> ). |
| Login/Session Errors | ||
| 2001 | ERROR_INCOMPATIBLE_VERSION | Request version %2 is not match with Catalog Version %1 |
| 2002 | ERROR_INVALID_LOGIN_INFO | Login failed. |
| 2003 | ERROR_INVALID_SESSION | Invalid Session ID. |
| 2004 | ERROR_NO_RIGHT_TO_SWITCH_USER | Login user does not have sufficient rights to impersonate to other users. |
| 2005 | ERROR_SWITCH_USER_NOT_FOUND | Office "%1" or user "%2" cannot be found. |
| 2006 | ERROR_INVALID_OFFICE_INFO | Invalid office info. |
| 2007 | ERROR_INVALID_USER_INFO | Invalid user info. |
| 2008 | ERROR_UNIQUEID_LOGIN_DISABLED | The UnqiueID Login is disabled, Please check the configuration file. |
| 2009 | ERROR_NO_RIGHT_TO_SWITCH_OFFICE | Login user does not have enough right to impersonate to other offices. |
| Object Errors | ||
| 3001 | ERROR_OBJECT_NOT_EXIST | Object is not found ( <%1> ). |
| 3002 | ERROR_OBJECT_NOT_SEARCHABLE | Object is not Searchable ( <%1> ). |
| 3003 | ERROR_OBJECT_READONLY | Object is read-only ( <%1> ). |
| 3004 | ERROR_OBJECT_ID | Invalid Object Id. |
| 3005 | ERROR_OBJECT_NO_ID | Object Id value is null or blank. |
| Property Errors | ||
| 4001 | ERROR_PROPERTY_NOT_EXIST | Property is not found ( <%1> ). |
| 4002 | ERROR_PROPERTY_NOT_SEARCHABLE | Property is not Searchable ( <%1> ). |
| 4003 | ERROR_PROPERTY_READONLY | Property is read only ( <%1> ). |
| 4004 | ERROR_PROPERTY_INVALID_OPTION | Invalid property option ( %1 ). |
| Keyword Errors | ||
| 5001 | ERROR_INVALID_FUNCTION | Invalid function ( %1 ). |
| 5002 | ERROR_INVALID_OPERATOR | Invalid operator ( %1 ). |
| 5003 | ERROR_INVALID_BOOLEAN | Invalid Boolean value ( %1 ). "true" or "false". |
| Condition Errors | ||
| 6001 | ERROR_COND_PROPERTY_NOT_ALLOWED | Property is not allowed in search condition ( %1 ). |
| 6002 | ERROR_COND_DATA_TYPE_NOT_ALLOWED | Property is not allowed in search condition ( %1 ) due to its data type (%2). |
| 6003 | ERROR_COND_NOT_EMBEDDED | Property is not embedded object ( "%1" in "%2" ). |
| 6004 | ERROR_SEARCH_NO_OBJECT | No object is specified to search. |
| 6005 | ERROR_EXPR_NO_PROPERTY | No property is specified in expression. |
| 6006 | ERROR_SEARCH_INVALID_SEARCHID | Invalid search ID ( %1 ). |
| 6007 | ERROR_COND_OBJECT_NOT_IN_JOIN | Embedded object is not include in join ( "%1" ). Maximum depth level of embedded object for search condition is 4. The depth of given property name may exceed the limit. |
| 6008 | ERROR_OPERATOR_NOT_ALLOWED | Operator ( %1 ) is not allowed for %2 ( %3 ). |
| 6009 | ERROR_INVALID_LINKID | Invalid Link ID ( %1 ). Target table primary keys cannot be referred by main table's Link ID. |
| 6010 | ERROR_INSUFFICENT_SEARCH_DATA | Insufficient search data. |
| Method Errors | ||
| 7001 | ERROR_METHOD_NOT_EXIST | Method is not found ( %1 ). |
| 7002 | ERROR_METHOD_INVOKE | Invoke method %1 failed. |
| Sync Errors | ||
| 8001 | ERROR_RMA_NOT_EXIST | RMA is not found ( %1 ). |
| 8002 | ERROR_IMPROPER_RETURN_OBJECT | Improper return object. |
| Data Access Errors | ||
| 10001 | ERROR_DATA_ACCESS_DENIED | The user does not have permission to access this module. Please contact an office administrator for further assistance. |