Thanks.  I'm doing this but I also do not see the stack trace in the
logs (you can see where I'm logging it below).  This means I'm not
registering or configuring the handler correctly.  I have a new
request factory servlet as thus:

public class FooRequestFactoryServlet extends RequestFactoryServlet {

  public FooRequestFactoryServlet() {
    super(new FooExceptionHandler());
  }
}

Where the relevant code in FooExceptionHandler is:

  @Override
  public ServerFailure createServerFailure(Throwable throwable) {

    LOGGER.error("A server error occurred", throwable);
    return new ServerFailure(throwable.getMessage(),         //
message
                             throwable.getClass().getName(), //
exception type
                             getFullStacktrace(throwable),   // stack
trace
                             true);                          // is
fatal
  }

FooExceptionHandler implements ExceptionHandler and
getFullStacktrace(...) simply returns a Stringified version of the
full stack trace.

Relevant lines from web.xml:
  <servlet>
    <servlet-name>gwtServlet</servlet-name>
    <servlet-class>com.foo.FooRequestFactoryServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>gwtServlet</servlet-name>
    <url-pattern>/gwtRequest</url-pattern>
  </servlet-mapping>

Clearly, I'm missing something here...any ideas?

I do realize there's a debate of whether or not the end user *needs*
the stacktrace.  If this were a production app and customer-facing,
clearly we wouldn't choose to do this.  This is for internal systems
used by our divisions and anything they can give support when they
open a ticket will help the lower support tiers find and fix the
problem faster - rather than having to parse the logs from the
division in question.  Sort of important when you have 52 divisions.

-ic

On Feb 1, 10:17 am, Thomas Broyer <[email protected]> wrote:
> Pass it as the message of the ServerFailure.
>
> (honestly, you really *need* it? users don't need stack traces, developers
> need them, for debugging; if you're trying to extract some information from
> the stack trace, then you're doing it wrong: don't throw an exception, but
> rather return an "error object")

-- 
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.

Reply via email to