Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

UmbrellaException causes are not listed in emulated stack trace for remotelogger #53

Closed
GoogleCodeExporter opened this issue Mar 13, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

Does the issue occur in "quirks mode", "standards mode" or both? If you
don't know, does your HTML page contains a DOCTYPE declaration?

At least standards mode

What version of GWT are you using? 1.4.60? 2.0.4? Other?

2.1

What version of the gwt-log jar file or library file are you using?

3.0.3

What operating system(s) are you using? Windows? Linux? Mac?

AppEngine

Does the issue occur in web mode, development mode (formerly "hosted
mode"), both or don't know?

Web mode

What steps will reproduce the problem? Please attach sample code if you
can.
1.  Enable remotelogger to log to appengine, and emulate stack traces
2.  Cause an exception in a response to an event propogated by a SimpleEventBus 
on the gwt client

What is the expected output? What do you see instead?

The error appears in the appengine log, but only the first chunk of the 
UmbrellaException - the stack around the firing of the event.  We do not see 
the stack up to the point of the problem, because the eventbus caught that 
exception and put it in the umbrella exception, to be thrown later.  On the 
client side, the whole UmbrellaException is displayed, causes included, in the 
Firebug console log.  I'd like to see the entire thing in the appengine log.

Do you have a workaround?

No.

Please provide any additional information below.

I love gwt-log!  The problem prompting this report was completely unknown to me 
before I installed gwt-log, and it's happening to a good 5% of my page loads... 
I just can't see why yet! ;)

Original issue reported on code.google.com by [email protected] on 13 Jan 2011 at 3:10

@GoogleCodeExporter
Copy link
Author

Workaround: 

I added a hacky little bit of code to the UnwrappedClientThrowable(wrapped) 
constructor to serialize all of the causes into a single stack trace.  The 
output isn't pretty, and there's some inefficient allocation, so I'm sure there 
are better ways.

   private UnwrappedClientThrowable(WrappedClientThrowable wrapped) {
    originalClassName = wrapped.getOriginalClassName();
    message = wrapped.getMessage();

    WrappedClientThrowable currentThrowable = wrapped;

    ArrayList<StackTraceElement> stackTrace = new ArrayList<StackTraceElement>();
        while (currentThrowable != null)
        {
            StackTraceElement[] clientStackTrace = currentThrowable.getClientStackTrace();
            if (clientStackTrace != null)
            {
                for (int i = 0; i < clientStackTrace.length; i++)
                {
                    stackTrace.add(new StackTraceElement(clientStackTrace[i].getClassName(),
                                    clientStackTrace[i].getMethodName(), clientStackTrace[i].getFileName(),
                                    clientStackTrace[i].getLineNumber()));
                }
            }

            currentThrowable = currentThrowable.getCause();

            if (currentThrowable != null)
            {
                stackTrace.add(new StackTraceElement("", "", "", 0));
                stackTrace.add(new StackTraceElement("==================Caused by==================", "", "", 0));
            }
        }

        setStackTrace(stackTrace.toArray(new StackTraceElement[stackTrace.size()]));
    }

Original comment by [email protected] on 19 Jan 2011 at 5:41

@GoogleCodeExporter
Copy link
Author

Thanks for finding this and the detailed report.

Fix committed in r547.

Original comment by [email protected] on 21 Jan 2011 at 10:31

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks for the quick fix - and much nicer than mine!

Original comment by [email protected] on 21 Jan 2011 at 11:32

@GoogleCodeExporter
Copy link
Author

Released in version 3.1.0

Original comment by [email protected] on 20 Jun 2011 at 11:51

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant