I am coding in a multitier architecture in Java, and I perform a query to a web service.
Is it better form for the errors returned by the service be handled in the data access layer or in the business layer?
For example, the service records a response something like this:
<?xml version="1.0" encoding="UTF-8"?> <ReturnCode>[integer]</ReturnCode> <ReturnMessage>[String correponding to ReturnCode]</ReturnMessage> <UpdateTimestamp>[dateTime - only present if ReturnCode == 0]</UpdateTimestamp> <UpdateUser>[string - only present if ReturnCode == 0]</UpdateUser> </xml>
If I handled the errors in the data access layer, my Java code would like something like this: Error logic in DAO. (notice the data type doesn't have
If I handled the errors in the business layer, the code would look like this: Error logic in BO. (notice the data type has