code: def task_failed(sender=None, **kwargs):
      
      if isinstance(sender, UserTaskMixin):
          exception = kwargs['exception']
          if not isinstance(exception, TaskCanceledException):
              # Don't include traceback, since this is intended for end users
              sender.status.fail(str(exception))
          user_task_stopped.send_robust(sender=UserTaskStatus, status=sender.status)
docs: Update the status record accordingly when a :py:class:`UserTaskMixin` fails.