Hi mike,
There is a sendRequest() method in the StreamClientCall to return the status
of the response .
The code had not set the error/exception message to client.
[code]
// Build the result
result = new Status(getStatusCode(), null, getReasonPhrase(), null);
[/code]
So you should add some getters in the abstract class HttpCall :
example: getStatusThrowable(), getStatusName(), getStatusUri()
And adding some code in sendResponse() method of the ServletCall that is a
subClass of the HttpServerCall or others subClass of the HttpServerCall that
is you used.
example:
[code]
if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
....
}
else if (Status.isError(getStatusCode()) && (response.getEntity() !=
null)) {
// your code here
}
[/code]
Actually, the response.getEntity() never should be null if the
Status.isError(getStatusCode()) is true.
Then, there is a parseResponse() method in the StreamClientCall to parse
the ServletCall return response ,then the getStatusThrowable(),
getStatusName(), getStatusUri() would work well.
I hope it will be helpful !
Thanks,
David
2008/8/20, Michael Dunn <[EMAIL PROTECTED]>:
>
> Are there best practices for error handling? I am extending a Resource
> object
> overriding the represent method. What is the be approach for returning an
> error
> to the user? Should I throw a ResourceException (as defined by the
> interface)
> or should I add the exception/error information to the Response? Or Both?
>
> Thanks
>
>