U
    ù6e  ã                   @   s8   d Z G dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z
Exceptions
~~~~~~~~~~
c                   @   s   e Zd ZdZdS )ÚAssemblingErrorzp
    Raised if the parser could not be configured due to malformed
    or conflicting command declarations.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú.lib/python3.8/site-packages/argh/exceptions.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚDispatchingErrorz‰
    Raised if the dispatching could not be completed due to misconfiguration
    which could not be determined on an earlier stage.
    Nr   r   r   r   r   r	      s   r	   c                       s&   e Zd ZdZddœ‡ fdd„
Z‡  ZS )ÚCommandErroraÀ  
    Intended to be raised from within a command.  The dispatcher wraps this
    exception by default and prints its message without traceback, then exits
    with exit code 1.

    Useful for print-and-exit tasks when you expect a failure and don't want
    to startle the ordinary user by the cryptic output.

    Consider the following example::

        def foo(args):
            try:
                ...
            except KeyError as e:
                print(u"Could not fetch item: {0}".format(e))
                sys.exit(1)

    It is exactly the same as::

        def bar(args):
            try:
                ...
            except KeyError as e:
                raise CommandError(u"Could not fetch item: {0}".format(e))

    To customize the exit status, pass an integer (as per ``sys.exit()``) to
    the ``code`` keyword arg.

    This exception can be safely used in both print-style and yield-style
    commands (see :doc:`tutorial`).
    N)Úcodec                   s   || _ tt| ƒj|Ž  d S )N)r   Úsuperr
   Ú__init__)Úselfr   Úargs©Ú	__class__r   r   r   ?   s    zCommandError.__init__)r   r   r   r   r   Ú__classcell__r   r   r   r   r
      s    r
   N)r   Ú	Exceptionr   r	   r
   r   r   r   r   Ú<module>
   s   