a
    d=icy                     @   s`   d Z G dd deZG dd deZG dd deZG dd deZG d	d
 d
eZdd ZdS )a  Error codes (experimental module).

These types represent a subset of the Google error codes [1], which are
also used by TensorFlow, gRPC, et al.

When an HTTP handler raises one of these errors, the TensorBoard core
application will catch it and automatically serve a properly formatted
response with the error message.

[1]: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
c                       s$   e Zd ZdZdZ fddZ  ZS )PublicErrora]  An error whose text does not contain sensitive information.

    Fields:
      http_code: Integer between 400 and 599 inclusive (e.g., 404).
      headers: List of additional key-value pairs to include in the
        response body, like `[("Allow", "GET")]` for HTTP 405 or
        `[("WWW-Authenticate", "Digest")]` for HTTP 401. May be empty.
    i  c                    s   t t| | g | _d S )N)superr   __init__headers)selfdetails	__class__ c/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/tensorboard/errors.pyr   (   s    zPublicError.__init____name__
__module____qualname____doc__Z	http_coder   __classcell__r	   r	   r   r
   r      s   	r   c                       s&   e Zd ZdZdZd fdd	Z  ZS )InvalidArgumentErrora  Client specified an invalid argument.

    The text of this error is assumed not to contain sensitive data,
    and so may appear in (e.g.) the response body of a failed HTTP
    request.

    Corresponds to HTTP 400 Bad Request or Google error code `INVALID_ARGUMENT`.
    i  Nc                    s   t d|}tt| | d S )NzInvalid argument)_format_messager   r   r   r   r   msgr   r	   r
   r   9   s    
zInvalidArgumentError.__init__)Nr   r	   r	   r   r
   r   -   s   	r   c                       s&   e Zd ZdZdZd fdd	Z  ZS )NotFoundErrora"  Some requested entity (e.g., file or directory) was not found.

    The text of this error is assumed not to contain sensitive data,
    and so may appear in (e.g.) the response body of a failed HTTP
    request.

    Corresponds to HTTP 404 Not Found or Google error code `NOT_FOUND`.
    i  Nc                    s   t d|}tt| | d S )Nz	Not found)r   r   r   r   r   r   r	   r
   r   J   s    
zNotFoundError.__init__)Nr   r	   r	   r   r
   r   >   s   	r   c                       s&   e Zd ZdZdZd fdd	Z  ZS )UnauthenticatedErrora  Request does not have valid authentication credentials for the operation.

    The text of this error is assumed not to contain sensitive data,
    and so may appear in (e.g.) the response body of a failed HTTP
    request.

    Corresponds to HTTP 401 Unauthorized (despite the name) or Google
    error code `UNAUTHENTICATED`. HTTP 401 responses are required to
    contain a `WWW-Authenticate` challenge, so `UnauthenticatedError`
    values are, too.
    i  Nc                   s.   t d|}tt| | | jd|f dS )aW  Initialize an `UnauthenticatedError`.

        Args;
          details: Optional public, user-facing error message, as a
            string or any value that can be converted to string, or
            `None` to omit details.
          challenge: String value of the `WWW-Authenticate` HTTP header
            as described in RFC 7235.
        ZUnauthenticatedzWWW-AuthenticateN)r   r   r   r   r   append)r   r   	challenger   r   r	   r
   r   ^   s    

zUnauthenticatedError.__init__)Nr   r	   r	   r   r
   r   O   s   r   c                       s&   e Zd ZdZdZd fdd	Z  ZS )PermissionDeniedErrora3  The caller does not have permission to execute the specified operation.

    The text of this error is assumed not to contain sensitive data,
    and so may appear in (e.g.) the response body of a failed HTTP
    request.

    Corresponds to HTTP 403 Forbidden or Google error code `PERMISSION_DENIED`.
    i  Nc                    s   t d|}tt| | d S )NzPermission denied)r   r   r   r   r   r   r	   r
   r   y   s    
zPermissionDeniedError.__init__)Nr   r	   r	   r   r
   r   m   s   	r   c                 C   s   |d u r| S d| |f S d S )Nz%s: %sr	   )Z	code_namer   r	   r	   r
   r   ~   s    r   N)r   RuntimeErrorr   r   r   r   r   r   r	   r	   r	   r
   <module>   s   