I uses a serialized exception. The class looks something like:
public class GwtAppException extends Exception implements Serializable
{
public GwtAppException() {
super();
// my code follows
}
public GwtAppException(String message) {
super(message);
// my code follows
}
... etc.
}
Put this somewhere that it complies for both client and server (the
way your RemoteServices do). Declare your RemoteServices methods to
throw this error.
In you client code,
AsyncCallback<String> callback = new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
Window.alert((new GwtAppException(caught)).getMessage());
}
...
On Oct 21, 8:09 am, András Csányi <[email protected]> wrote:
> On 21 October 2011 13:56, Sean <[email protected]> wrote:
>
> > I also recommend creating a Serialized Exception, and have ALL your RPCs do
> > adequate error handling and throw these Serialized Exceptions for display on
> > your page. This has made RPC debugging 3000x better.
>
> Sean, it sounds really good, but I'm very new at GWT and java as well.
> So, would you so kind to provide a simple example which is usable?
>
> Many thanks in advance!
>
> --
> - -
> -- Csanyi Andras (Sayusi Ando)
> --http://sayusi.hu--http://facebook.com/andras.csanyi
> -- ""Trust in God and keep your gunpowder dry!" - Cromwell
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.