Thanks for taking the time to explain it so carefully. You are a good
person.Thanks again, Lothar.

Viet Pham


On Fri, Jan 9, 2009 at 12:28 AM, Lothar Kimmeringer <[email protected]>wrote:

>
> Pham Tran Quoc Viet schrieb:
>
> > By the way, I could not find RemoteServiceException in GWT doc. So, I
> > assume it's your custom exception, right?
>
> That's correct. But it's nothing very secret happening there so I
> can post it here without being sent to the south-east-end of Cuba ;-)
>
> ------snip
> /**
>  * Exception that will be thrown if there was an error while performing
>  * remote functions on the server
>  * @author "Lothar Kimmeringer" 
> &lt;[email protected]<lt%[email protected]>
> >
>  *
>  */
> public class RemoteServiceException extends SerializableException {
>    private String stackTrace;
>    private String message;
>
>    private static final long serialVersionUID = 2L;
>
>    /**
>     * Creates a new instance of RemoteServiceException
>     */
>    public RemoteServiceException() {
>        super();
>    }
>
>    /**
>     * Creates a new instance of RemoteServiceException
>     * @param message The message indicating the reason for the exception
>     * @param cause The cause leading to the exception
>     */
>    public RemoteServiceException(String message, String cause) {
>        super(message);
>        this.message = message;
>        stackTrace = cause;
>    }
>
>    /**
>     * Creates a new instance of RemoteServiceException
>     * @param message The message indicating the reason for the exception
>     */
>    public RemoteServiceException(String message) {
>        super(message);
>        this.message = message;
>    }
>
>    /**
>     * Returns the stacktrace of the cause
>     * @return The cause
>     */
>    public String getCauseStackTrace() {
>        return stackTrace;
>    }
>
>    /**
>     * Returns the message of the exception
>     */
>    public String getMessage(){
>        return message;
>    }
> }
> ------snip
>
> You can get the stacktrace as string doing the following:
>
> StringWriter sw = new StringWriter();
> throwable.printStackTrace(new PrintWriter(sw));
> String stacktrace = sw.toString();
>
> You have to do it outside the above exception, because the exception above
> must be in a client-package, i.e. you are restricted to the GWT Java
> ruling out PrintWriter at least.
>
>
> Regards, Lothar
>
> >
>

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