Hi there,
I am using GWT 2.5.1 request factory. On client, after I fire the request, I have this block to display any error message from server.
public void onFailure(ServerFailure error) {
// do something with error.getMessage()
}
On server, I extended ServceLayerDecorator like this, but I do not know how to handle exception so that the message will show up in ServerFailure.getMessage().
I tried simply rethrowing the exception, I am getting HTML text such as server 500 error in ServerFailure.getMessage().
@Override
public Object invoke(Method domainMethod, Object... args) {
try {
// some business logic such as check user role, etc.
return super.invoke(domainMethod, args);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
How does this exception on Server side gets translated into ServerFailure on client and who is doing that? Maybe that is where I need to override?
Thanks,
Yan