aboutsummaryrefslogtreecommitdiff
o

Mifz@s8ddlZddlmZGdddeZGdddeZdS)N)	HTTPErrorcs eZdZdZfddZZS)UnprocessableEntitya
An HTTP 422 Unprocessable Entity error occurred.

    https://help.helpjuice.com/en_US/api-v3/api-v3#errors

    The request could not be processed, usually due to a missing or invalid parameter.

    The response will also include an error object with an explanation of fields that
    are missing or invalid. Here is an example:

    .. code-block::

        HTTP/1.1 422 Unprocessable Entity


        {
          "errors": [
            {
              "email": "is not valid."
            }
          ]
        }
    c	sttt|j}|}|D]%\}}||d}|s#qt	|t
r/|d|}qt	|tr;|d|}qt
|}tt|j|||ddS)zUnprocessableEntity constructor.

        Parses out error information from the error object and passes on to the
        :obj:`HTTPError` constructor.

        Args:
            exc (:obj:`HTTPError`): Original exception.
        Nr requestresponse)nextiterjsonloadsbodydecodevaluesitemsget
isinstancelistinsertstrdumpssuperr__init__)	selfrrrq_jsonerrorsfielderrorrq_fieldmsg	__class__0/home/shebes/code/rag_eval/src/errors/rag_err.pyr s	




zUnprocessableEntity.__init__)__name__
__module____qualname____doc__r
__classcell__r!r!rr"rsrcseZdZfddZZS)LLMErrorcstt|j|||ddS)Nr)rrr)rrrrrr!r"r<s

zLLMError.__init__)r#r$r%rr'r!r!rr"r(;sr()r
requestsrrr(r!r!r!r"<module>s3