/** * Called when a backend (or other framework code) encounters an exception that it can recover * from, but which it would like to report in some orderly fashion. <em>NOTE:</em> this method * may be called from threads other than the main PlayN thread. */ public static void reportError(String message, Throwable err) { platform.reportError(message, err); }
protected void emitFrame () { try { frame.emit(this); } catch (Throwable e) { reportError("Frame tick exception", e); } } }
private void dispatch () { synchronized (this) { running.addAll(pending); pending.clear(); } for (int ii = 0, ll = running.size(); ii < ll; ii++) { Runnable action = running.get(ii); try { action.run(); } catch (Throwable e) { plat.reportError("invokeLater Runnable failed: " + action, e); } } running.clear(); } }
/** * Dispatches {@code event} on {@code signal} and catches any error that propagates out of the * event dispatch, reporting it via {@link #reportError}. */ public <E> void dispatchEvent (Signal<E> signal, E event) { try { signal.emit(event); } catch (Throwable cause) { reportError("Event dispatch failure", cause); } }
protected void emitFrame () { try { frame.emit(this); } catch (Throwable e) { reportError("Frame tick exception", e); } } }
/** * Dispatches {@code event} on {@code signal} and catches any error that propagates out of the * event dispatch, reporting it via {@link #reportError}. */ public <E> void dispatchEvent (Signal<E> signal, E event) { try { signal.emit(event); } catch (Throwable cause) { reportError("Event dispatch failure", cause); } }
private void dispatch () { synchronized (this) { running.addAll(pending); pending.clear(); } for (int ii = 0, ll = running.size(); ii < ll; ii++) { Runnable action = running.get(ii); try { action.run(); } catch (Throwable e) { plat.reportError("invokeLater Runnable failed: " + action, e); } } running.clear(); } }