def METHOD_NAME(self, task_token: str, details: str | None = None, reason: str | None = None) -> dict[str, Any] | None:
    """Replies to ``swf`` that the activity task failed
    :param  task_token: canceled activity task token
    :param  details: provided details about the failure
    :param  reason: Description of the error that may assist in diagnostics
    """
    try:
        return self.connection.respond_activity_task_failed(
            task_token,
            details=format.details(details),
            reason=format.reason(reason),
        )
    except boto.exception.SWFResponseError as e:
        message = self.get_error_message(e)
        if e.error_code == "UnknownResourceFault":
            raise DoesNotExistError(
                f"Unable to fail activity task with token={task_token}",
                message,
            )
        raise ResponseError(message)
    except JumboTooLargeError as e:
        return self.connection.respond_activity_task_failed(task_token, reason=format_exc(e))