/** * Creates a response that indicates the request has failed. The {@link #getMessage() message} is set to * to an abbreviated representation of the exception and its causes, but the * {@link com.atlassian.scheduler.status.RunDetails#MAXIMUM_MESSAGE_LENGTH} still applies, so this information may be incomplete. * When possible, the {@link JobRunner} is encouraged to trap its exceptions and report more specific * diagnostic messages with {@link #failed(String)}, instead. * * @param cause the exception that caused this failure * @return the response */ public static JobRunnerResponse failed(final Throwable cause) { return new JobRunnerResponse(FAILED, toMessage(requireNonNull(cause, "cause"))); }