private static void start(Consumer cons, final CommandListener listener) throws DTraceException { cons.enable(); cons.go( new ExceptionHandler() { @Override public void handleException(Throwable th) { try { listener.onCommand(new ErrorCommand(th)); } catch (IOException ioexp) { ioexp.printStackTrace(); } } }); }
private static void start(Consumer cons) throws DTraceException { cons.enable(); cons.go( new ExceptionHandler() { @Override public void handleException(final Throwable th) { rt.send( ErrorCommand.class, new AbstractCommand.Initializer<ErrorCommand>() { public void init(ErrorCommand cmd) { cmd.setCause(th); } }); } }); }