
    $jY                     J    d dl m Z   G d de          Z G d de          ZdS )    )datetimec                   .     e Zd ZdZddedef fdZ xZS )RetryTaskAtzARaise from a task handler to schedule a retry at a specific time. retry_atmessagec                 X    || _         t                                          |           d S N)r   super__init__)selfr   r   	__class__s      g/home/rurouni/.hermes/hermes-agent/venv/lib/python3.11/site-packages/hindsight_api/worker/exceptions.pyr   zRetryTaskAt.__init__   s(     !!!!!    r   __name__
__module____qualname____doc__r   strr   __classcell__r   s   @r   r   r      sV        KK" " "C " " " " " " " " " "r   r   c                   .     e Zd ZdZddedef fdZ xZS )DeferOperationu}  Raise from an extension hook (or task handler) to requeue the
    operation for execution at a later time, without counting as a retry.

    Unlike `RetryTaskAt`, this is not a failure: `retry_count` is not
    incremented and `error_message` is not written. Use this for
    backpressure / "not yet, try later" decisions made before or during
    task execution (e.g. quota windows, warming dependencies, upstream
    rate limits).

    Worker-only: raising this from a hook called in HTTP request context
    (e.g. `validate_recall` for a synchronous recall) will surface as an
    unhandled 500 — there is no queue to defer to.
    r   	exec_datereasonc                 f    || _         || _        t                                          |           d S r
   )r   r   r   r   )r   r   r   r   s      r   r   zDeferOperation.__init__   s/    "     r   r   r   r   s   @r   r   r      sZ         ! !( !C ! ! ! ! ! ! ! ! ! !r   r   N)r   	Exceptionr   r    r   r   <module>r!      su         " " " " ") " " "! ! ! ! !Y ! ! ! ! !r   