As with all applications, your application should implement at least basic error handling. Doing so grants a number of benefits to the application and the application's end users.
The most prevalent benefit is the graceful recovery of the application from error states. Without even the simplest form of error handling in an application, its execution can be brought to a complete halt by an error returned by eBay.
Another benefit is that the application can display errors that are more meaningful to the end user, who will likely not know about the errors that could occur.
Also, by incorporating error handling, an application can more easily be localized for use in different languages. If the application's error messages that correspond to the API error messages are stored in something like a string table, then different string tables can readily be substituted for different languages.
When a problem occurs and a request — or a portion of a request — cannot be executed for some reason, the response includes a list of errors instead of the normal business data. If the request is executed successfully but a minor problem was found or a change was made that you might not expect, the response includes the normal business data accompanied by a list of warnings.
It is a good idea to understand the types of errors and warnings that eBay may return so that you can design your application to handle them gracefully. Sometimes, errors may occur due to problems on eBay's side. For example, Trading API error 10007 ("System error. Unable to process your request. Please try again later.") indicates an error on the eBay server side, not an error in your application. It is important to understand how to determine whether this has occurred, and when to contact eBay for help.
The eBay Platform defines two general types of errors:
- Application-level errors occur due to problems with business-level data. In these cases, a list of errors is returned within the response message payload.
- Infrastructure errors indicate a problem on eBay's side with a database or server going down, or a problem with the client-side or server-side SOAP framework.
Refer to Errors by Number for the list of all possible error codes and messages that may be returned.