def METHOD_NAME(self, ex: CallbackOutcomeFailureError) -> FailureEvent:
    callback_outcome_failure: CallbackOutcomeFailure = ex.callback_outcome_failure
    error: str = callback_outcome_failure.error
    return FailureEvent(
        error_name=CustomErrorName(error_name=callback_outcome_failure.error),
        event_type=HistoryEventType.TaskFailed,
        event_details=EventDetails(
            taskFailedEventDetails=TaskFailedEventDetails(
                resourceType=self._get_sfn_resource_type(),
                resource=self._get_sfn_resource(),
                error=error,
                cause=callback_outcome_failure.cause,
            )
        ),
    )