def METHOD_NAME(self, task):
    c = task.captcha_params["file"]
    try:
        ticket, result = self.submit(c)
    except DeathByCaptchaException as exc:
        task.error = exc.get_code()
        self.log_error(exc)
        return
    task.data["ticket"] = ticket
    task.set_result(result)