protected void castFireEvent(GwtEvent<?> event) { try { fireEvent((Event<?>) event); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { throw new UmbrellaException(e.getCauses()); } }
/** * Called after all Receivers have been executed. */ protected void finish() { if (toThrow != null) { // Reset if the user wants to re-fire the Request Set<Throwable> causes = toThrow; toThrow = null; throw new UmbrellaException(causes); } }
public UmbrellaException(Set<Throwable> causes) { super(makeMessage(causes), makeCause(causes)); this.causes = causes; int i = 0; for (Throwable cause : causes) { if (i++ == 0) { // First one already added as cause. continue; } addSuppressed(cause); } }
causes = new HashSet<Throwable>(); causes.addAll(e.getCauses()); throw new UmbrellaException(causes);
public UmbrellaException(Set<Throwable> causes) { super(makeMessage(causes), makeCause(causes)); this.causes = causes; }
public void testReentrantEventsAreFiredIfThereWasAnException() { final SimplerEventBus reg = new SimplerEventBus(); // a flag to make our first handler cause a reentrant event final boolean fireAgain[] = { true }; final List<Integer> orderOfFires = new ArrayList<Integer>(); // setup 1st handler that will conditionally be reentrant reg.addHandler(ClickEvent.getType(), new ClickHandler() { public void onClick(ClickEvent arg0) { // make a reentrant event, e.g. a change handler caused another change event orderOfFires.add(1); if (fireAgain[0]) { fireAgain[0] = false; fireClickEvent(reg); } } }); // setup 2nd handler to fail reg.addHandler(ClickEvent.getType(), new ClickHandler() { public void onClick(ClickEvent arg0) { throw new RuntimeException("failed"); } }); try { fireClickEvent(reg); } catch (UmbrellaException r) { assertThat(r.getMessage(), is("2 exceptions caught: failed; failed")); assertThat(r.getCauses().size(), is(2)); } assertThat(orderOfFires, contains(1, 1)); }
throw new UmbrellaException(causes);
protected void castFireEventFromSource(GwtEvent<?> event, Object source) { try { fireEventFromSource((Event<?>) event, source); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { throw new UmbrellaException(e.getCauses()); } }
public UmbrellaException(Set<Throwable> causes) { super(makeMessage(causes), makeCause(causes)); this.causes = causes; int i = 0; for (Throwable cause : causes) { if (i++ == 0) { // First one already added as cause. continue; } addSuppressed(cause); } }
throw new UmbrellaException(causes);
throw new UmbrellaException(e.getCauses()); } finally { if (oldSource == null) {
public UmbrellaException(Set<Throwable> causes) { super(makeMessage(causes), makeCause(causes)); this.causes = causes; int i = 0; for (Throwable cause : causes) { if (i++ == 0) { // First one already added as cause. continue; } addSuppressed(cause); } }
throw new UmbrellaException(causes);
throw new UmbrellaException(causes);
protected void castFireEvent(GwtEvent<?> event) { try { fireEvent((Event<?>) event); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { throw new UmbrellaException(e.getCauses()); } }
/** * Called after all Receivers have been executed. */ protected void finish() { if (toThrow != null) { // Reset if the user wants to re-fire the Request Set<Throwable> causes = toThrow; toThrow = null; throw new UmbrellaException(causes); } }
protected void castFireEventFromSource(GwtEvent<?> event, Object source) { try { fireEventFromSource((Event<?>) event, source); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { throw new UmbrellaException(e.getCauses()); } }
/** * Called after all Receivers have been executed. */ protected void finish() { if (toThrow != null) { // Reset if the user wants to re-fire the Request Set<Throwable> causes = toThrow; toThrow = null; throw new UmbrellaException(causes); } }
protected void castFireEvent(GwtEvent<?> event) { try { fireEvent((Event<?>) event); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { throw new UmbrellaException(e.getCauses()); } }