o
    ei                     @   s   U d Z ddlmZmZ ddlmZmZmZmZm	Z	m
Z
mZ edd e
dd edd edd ed	d e	d
d edd edd iZeee eegef f ed< dedee fddZdS )zCLI error handling utilities.    )CallableOptional)BucketNotFoundErrorGatedRepoErrorHfHubHTTPErrorLocalTokenNotFoundErrorRemoteEntryNotFoundErrorRepositoryNotFoundErrorRevisionNotFoundErrorc                 C      dS )NzrBucket not found. Check the bucket id (namespace/name). If the bucket is private, make sure you are authenticated. er   r   Y/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/huggingface_hub/cli/_errors.py<lambda>      r   c                 C   r   )Nz~Repository not found. Check the `repo_id` and `repo_type` parameters. If the repo is private, make sure you are authenticated.r   r   r   r   r   r   !   r   c                 C   r   )Nz3Revision not found. Check the `revision` parameter.r   r   r   r   r   r   $       c                 C   r   )Nz1Access denied. This repository requires approval.r   r   r   r   r   r   %   r   c                 C   r   )Nz)Not logged in. Run 'hf auth login' first.r   r   r   r   r   r   &   r   c                 C   r   )NzFile not found in repository.r   r   r   r   r   r   '   r   c                 C   s   t | S N)strr   r   r   r   r   (   s    c                 C   s
   d|  S )NzInvalid value. r   r   r   r   r   r   )   s   
 CLI_ERROR_MAPPINGSr   returnc                 C   s,   t  D ]\}}t| |r||   S qd S r   )r   items
isinstance)r   exc_type	formatterr   r   r   format_known_exception-   s
   
r   N)__doc__typingr   r   huggingface_hub.errorsr   r   r   r   r   r	   r
   
ValueErrorr   dicttype	Exceptionr   __annotations__r   r   r   r   r   <module>   s   $"