@Override public boolean apply(@Nullable Integer input) { if (input==0) return true; try { String notes = ""; if (!getResultStderr().isEmpty()) notes += "STDERR\n" + getResultStderr()+"\n"; if (!getResultStdout().isEmpty()) notes += "\n" + "STDOUT\n" + getResultStdout()+"\n"; Tasks.setExtraStatusDetails(notes.trim()); } catch (Exception e) { log.warn("Unable to collect additional metadata on failure of "+summary+": "+e); } return false; } };
@Override public boolean apply(@Nullable Integer input) { if (input==0) return true; try { String notes = ""; if (!getResultStderr().isEmpty()) notes += "STDERR\n" + getResultStderr()+"\n"; if (!getResultStdout().isEmpty()) notes += "\n" + "STDOUT\n" + getResultStdout()+"\n"; Tasks.setExtraStatusDetails(notes.trim()); } catch (Exception e) { LOG.warn("Unable to collect additional metadata on failure of "+summary+": "+e); } return false; } };
@Override public void waitabit() throws Exception { waitingTask.set(Tasks.current()); Tasks.setExtraStatusDetails("waitabit extra status details"); Tasks.withBlockingDetails("waitabit.blocking", new Callable<Void>() { @Override public Void call() throws Exception { nowWaitingLatch.countDown(); if (!continueFromWaitingLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) { fail("took too long to be told to continue"); } return null; }}); }
Tasks.setExtraStatusDetails(notes.trim());