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(); } } }); }