try {
if (failureCause == null) {
callback.onSuccess(result.getEvent(), inputContext);
} else {
callback.onFailure(result.getEvent(), inputContext,
new FailureReason(failureType, failureCause.getMessage(), failureCause),
createInputAcknowledger(input));
}
} catch (Throwable t) {
LOG.error("Failed to invoke callback.", t);
}