Aw: Re: Strange History Behaviour

2011-06-21 Thread Sven
We just made a custom PlaceController and Historian to share some log 
messages. Most of the google methods are private so that we can't just 
override them implementing our log messages.

You mentioned GWT.setUncaughtExceptionHandler and i already placed it in my 
code. But it may be the wrong place. Where do i have to place it to catch 
all the exceptions mentioned?


But maybe our placecontroller puts some magic in there:

public DfsPlaceController(EventBus eventBus) {
super(eventBus);
}

public DfsPlaceController(EventBus eventBus, Delegate delegate) {
super(eventBus, delegate);
}

protected BreadcrumbBar createBreadcrumbBar() {
BreadcrumbBar breadcrumbBar = new BreadcrumbBar();
return breadcrumbBar;
}

@Override
public void goTo(Place newPlace) {
LOG.debug(goTo:  + newPlace);
super.goTo(newPlace);
updateBreadcrumbBar(newPlace);
}

public void updateBreadcrumbBar() {
updateBreadcrumbBar(getWhere());
}

protected void updateBreadcrumbBar(Place place) {
try {

RootPanel breadcrumbRootPanel = RootPanel.get(breadcrumb);
if (breadcrumbRootPanel.getWidgetCount() == 0) {
LOG.debug(#updateBreadcrumbBar: No breadcrumb rootpanel 
available.);
return;
}

Widget widget = breadcrumbRootPanel.getWidget(0);
if (!(widget instanceof BreadcrumbBar)) {
LOG.debug(#updateBreadcrumbBar: The first widget is not the 
breadcrumb bar.);
return;
}

BreadcrumbBar breadcrumbBar = (BreadcrumbBar) widget;
BreadcrumbItem[] items = BreadcrumbBar.NO_BREADCRUMB_ITEMS;
if (place instanceof AbstractPlace) {
AbstractPlace abstractPlace = (AbstractPlace) place;
items = abstractPlace.getBreadcrumbItems();
}
breadcrumbBar.setBreadcrumbItems(items);

} catch (Exception ex) {
LOG.error(Unable to update breadcrumb bar., ex);
}
}


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/iBRD7KmQTPwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Aw: Re: Strange History Behaviour

2011-06-21 Thread Sven
UPDATE:

after try catching in my AbstractClientFactory i found something:

protected EventBus createEventBus() {
return new SimpleEventBus() {

@Override
public void fireEvent(Event? event) {
try {
LOG.debug(#fireEvent(Event? event):  + event != null ? 
event.toDebugString() : null);

super.fireEvent(event);
}catch(Exception e){
LOG.error(fire event failed:  + 
e.getCause().getMessage());
}
}

@Override
public void fireEvent(GwtEvent? event) {
try {
LOG.debug(#fireEvent(GwtEvent? event) + event != null ? 
event.toDebugString() : null);
super.fireEvent(event);
}catch(Exception e){
LOG.error(fire gwtevent failed:  + 
e.getCause().getMessage());
}
}
};
}

like you said the inner class (in this case the new SimpleEventBus) is the 
problem. fireEvent(Event? event) runs in my catch method. Problem is that 
the exception just says that i should check the umbrella exception for the 
cause. I don't know how to get this one? Or is this the point where i should 
place my GWT.setUncaughtExceptionHandler?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/v95As2zE_kcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Aw: Re: Strange History Behaviour

2011-06-21 Thread Thomas Broyer
try {
  super.fireEvent(event);
} catch (UmbrellaException ue) {
  for (Throwable t : ue.getCauses()) {
// here, use your code that prints the stack-trace; and if it's not 
enough, loop over the getCause() hierarchy
  }
}

An UncaughtExceptionHandler is a global catch: basically, your GWT code is 
run in a big try/catch, so any exception you don't catch will go to your 
UncaughtExceptionHandler (if you set one; or they'll generate JavaScript 
errors in your browser console)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Dzqlz4vwqSoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Aw: Re: Strange History Behaviour

2011-06-21 Thread Sven
I solved it You won't believe it... My View is currently using a third 
party calendar which needs to be implemented via native js. Deep in my 
UmbrellaExceptions I found something like $wnd.Calendar is null or wrong 
type. However this was firing an event which got recognized by GWT an 
encapsulated in about 10 UmbrellaExceptions... I also didn't find it because 
I casted to UmbrellaException from gwt shared package but it was from 
bindery package shared ;)

Crazy stuff but thx for your help Thomas.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/yV0S8GNl9KwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Aw: Re: Strange History Behaviour

2011-06-21 Thread Sven
This showed me the root of the problem ;)

import com.google.web.bindery.event.shared.UmbrellaException;
...

...
private void checkAndPrintException(Throwable ex) {
if(ex instanceof UmbrellaException){
LOG.debug(UMBRELLA EXCEPTION FOUND);
UmbrellaException umbEx = (UmbrellaException)ex;
for(Throwable t: umbEx.getCauses()){
if(t != null){
checkAndPrintException(t);
LOG.debug(Throwable caught:  + t.getMessage());
}
}
}
}

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/aOKYKcpBLvYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.