
    g                          G d  de       Z G d de      Z G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z G d de      Z	y)c                       e Zd Zy)PlotlyErrorN__name__
__module____qualname__     U/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/_plotly_utils/exceptions.pyr   r          r	   r   c                       e Zd Zy)PlotlyEmptyDataErrorNr   r   r	   r
   r   r      r   r	   r   c                   &     e Zd Zd fd	Zd Z xZS )PlotlyGraphObjectErrorc                 v    || _         || _        t        |      | _        || _        t
        t        |   |       y)a  
        General graph object error for validation failures.

        :param (str|unicode) message: The error message.
        :param (iterable) path: A path pointing to the error.
        :param notes: Add additional notes, but keep default exception message.

        N)messageplain_messagelistpathnotessuperr   __init__)selfr   r   r   	__class__s       r
   r   zPlotlyGraphObjectError.__init__
   s6     $J	
$d4W=r	   c                     | j                   ddj                  d | j                  D              z   dz   dj                  | j                        d} dj                  di |S )	z6This is called by Python to present the error message.[z][c              3   2   K   | ]  }t        |        y wN)repr).0ks     r
   	<genexpr>z1PlotlyGraphObjectError.__str__.<locals>.<genexpr>   s     #?DG#?s   ]
r   r   r   z){message}

Path To Error: {path}

{notes}r   )r   joinr   r   format)r   format_dicts     r
   __str__zPlotlyGraphObjectError.__str__   s\     ||$))#?TYY#???#EYYtzz*

 F>EETTTr	   ) r   r   )r   r   r   r   r(   __classcell__r   s   @r
   r   r   	   s    >Ur	   r   c                         e Zd Zd fd	Z xZS )PlotlyDictKeyErrorc                     |d   |j                   d} dj                  di |}|j                  d      gt        |      z   }t        t
        |   |||       y)	3See PlotlyGraphObjectError.__init__ for param docs.	attributeobject_namez/'{attribute}' is not allowed in '{object_name}'Treturn_helpr$   Nr   )_namer&   helpr   r   r-   r   r   objr   r   r'   r   r   s         r
   r   zPlotlyDictKeyError.__init__$   sj    $(HSYYGJCJJ 

 d+,tE{: $0$e 	1 	
r	   r   r   r   r   r   r*   r+   s   @r
   r-   r-   #       	
 	
r	   r-   c                         e Zd Zd fd	Z xZS )PlotlyDictValueErrorc                     |d   |j                   d} dj                  di |}|j                  |d   d      gt        |      z   }t        t
        |   |||       y)	r/   r0   r1   z6'{attribute}' has invalid value inside '{object_name}'Tr4   )r   r   r   Nr   )r6   r&   r7   r   r   r>   r   r8   s         r
   r   zPlotlyDictValueError.__init__1   sp    $(HSYYGQJQQ 

 $r(56eD"D25t 	3 	
r	   r:   r;   r+   s   @r
   r>   r>   0   r<   r	   r>   c                         e Zd Zd fd	Z xZS )PlotlyListEntryErrorc                     |d   |j                   d} dj                  di |}|j                  d      gt        |      z   }t        t
        |   |||       y)	r/   r0   indexr3   :Invalid entry found in '{object_name}' at index, '{index}'Tr4   r$   Nr   )r6   r&   r7   r   r   rA   r   r8   s         r
   r   zPlotlyListEntryError.__init__>   sj     $RCUNUU 

 d+,tE{:"D2$e 	3 	
r	   r:   r;   r+   s   @r
   rA   rA   =   r<   r	   rA   c                         e Zd Zd fd	Z xZS )PlotlyDataTypeErrorc                     |d   |j                   d} dj                  di |}d}|gt        |      z   }t        t        |   |||       y)r/   r0   rC   rE   z=It's invalid because it doesn't contain a valid 'type' value.r$   Nr   )r6   r&   r   r   rG   r   )r   r9   r   r   r'   r   noter   s          r
   r   zPlotlyDataTypeError.__init__K   sd     $RCUNUU 

 Oe$!41$e 	2 	
r	   r:   r;   r+   s   @r
   rG   rG   J   s    

 

r	   rG   c                       e Zd ZdZd Zy)PlotlyKeyErrora  
    KeyErrors are not printed as beautifully as other errors (this is so that
    {}[''] prints    "KeyError: ''" and not "KeyError:"). So here we use
    LookupError's __str__ to make a PlotlyKeyError object which will print nicer
    error messages for KeyErrors.
    c                 ,    t         j                  |       S r   )LookupErrorr(   )r   s    r
   r(   zPlotlyKeyError.__str__`   s    ""4((r	   N)r   r   r   __doc__r(   r   r	   r
   rK   rK   X   s    )r	   rK   N)
	Exceptionr   r   r   r-   r>   rA   rG   KeyErrorrK   r   r	   r
   <module>rQ      sk   	) 		; 	U[ U4

/ 



1 



1 


0 
	)X 	)r	   