
    'gWg                    8   U d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ej                  r$dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ  G d de      Z G d de      Z G d de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# 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 d0 d1e      Z+ G d2 d3e      Z, G d4 d5e      Z- G d6 d7e      Z. G d8 d9e      Z/ G d: d;e      Z0 G d< d=e      Z1 G d> d?e      Z2 G d@ dAe      Z3 G dB dCe      Z4 G dD dEe      Z5 G dF dGe5      Z6 G dH dIe      Z7 G dJ dKe      Z8 G dL dMe      Z9 G dN dOe      Z: G dP dQe      Z; G dR dSe5      Z< G dT dUe      Z= G dV dWe      Z>i Z?dXe@dY<   d_dZZA eA        [A G d[ d\      ZBd`d]ZC eB       ZDd\e@d^<   y)aa  Implements a number of Python exceptions which can be raised from within
a view to trigger a standard HTTP non-200 response.

Usage Example
-------------

.. code-block:: python

    from werkzeug.wrappers.request import Request
    from werkzeug.exceptions import HTTPException, NotFound

    def view(request):
        raise NotFound()

    @Request.application
    def application(request):
        try:
            return view(request)
        except HTTPException as e:
            return e

As you can see from this example those exceptions are callable WSGI
applications. However, they are not Werkzeug response objects. You
can get a response object by calling ``get_response()`` on a HTTP
exception.

Keep in mind that you may have to pass an environ (WSGI) or scope
(ASGI) to ``get_response()`` because some errors fetch additional
information relating to the request.

If you want to hook in a different exception page to say, a 404 status
code, you can add a second except for a specific subclass of an error:

.. code-block:: python

    @Request.application
    def application(request):
        try:
            return view(request)
        except NotFound as e:
            return not_found(request)
        except HTTPException as e:
            return e

    )annotationsN)datetime)escape)Markup   )_get_environ)StartResponse)WSGIEnvironmentWWWAuthenticateResponse)Requestc                       e Zd ZU dZdZded<   dZded<   	 	 d	 	 	 	 	 d fdZedd       Z		 	 d	 	 	 	 	 dd	Z
	 	 d	 	 	 	 	 dd
Z	 	 d	 	 	 	 	 ddZ	 	 d	 	 	 	 	 ddZ	 	 	 	 	 	 ddZddZddZ xZS )HTTPExceptiona#  The base class for all HTTP exceptions. This exception can be called as a WSGI
    application to render a default error page or you can catch the subclasses
    of it independently and render nicer error messages.

    .. versionchanged:: 2.1
        Removed the ``wrap`` class method.
    N
int | Nonecode
str | Nonedescriptionc                B    t         |           ||| _        || _        y N)super__init__r   response)selfr   r   	__class__s      K/var/www/html/knws/venv/lib/python3.12/site-packages/werkzeug/exceptions.pyr   zHTTPException.__init__O   s%    
 	"*D     c                F    ddl m} |j                  | j                  d      S )zThe status name.r   )HTTP_STATUS_CODESzUnknown Error)httpr    getr   )r   r    s     r   namezHTTPException.nameY   s     	, $$TYY@@r   c                    | j                   d}n| j                   }t        |      j                  dt        d            }d| dS )zGet the description. 
z<br>z<p>z</p>)r   r   replacer   )r   environscoper   s       r   get_descriptionzHTTPException.get_description`   sJ     #K**K[)11$vG[M&&r   c           
         d| j                    dt        | j                         dt        | j                         d| j                  |       d	S )zGet the HTML body.z&<!doctype html>
<html lang=en>
<title> z</title>
<h1>z</h1>
r&   )r   r   r#   r*   r   r(   r)   s      r   get_bodyzHTTPException.get_bodyn   sS    ii[&"3!4 5$))$%W##G,-R	1	
r   c                    dgS )zGet a list of headers.)zContent-Typeztext/html; charset=utf-8 r-   s      r   get_headerszHTTPException.get_headers|   s     ===r   c                    ddl m} | j                  | j                  S |t        |      }| j	                  ||      } || j                  ||      | j                  |      S )ah  Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        r   r   )wrappers.responser   r   r   r1   r.   r   )r   r(   r)   WSGIResponseheaderss        r   get_responsezHTTPException.get_response   s\     	@==$== "7+G""7E2DMM'59499gNNr   c                ^    t        j                  d| j                  |            } |||      S )zCall the exception as WSGI application.

        :param environ: the WSGI environment.
        :param start_response: the response callable provided by the WSGI
                               server.
        r4   )tcastr6   )r   r(   start_responser   s       r   __call__zHTTPException.__call__   s,     66.$*;*;G*DE00r   c                r    | j                   | j                   nd}| d| j                   d| j                   S )N???r,   : )r   r#   r   r   r   s     r   __str__zHTTPException.__str__   s8     II1tyyuq2d&6&6%788r   c                    | j                   | j                   nd}dt        |       j                   d| d| j                   dS )Nr=   <z 'r>   z'>)r   type__name__r#   r?   s     r   __repr__zHTTPException.__repr__   s@     II1tyyu4:&&'r$r$))B??r   NN)r   r   r   Response | NonereturnNonerH   str)r(   WSGIEnvironment | Noner)   dict[str, t.Any] | NonerH   rK   r(   rL   r)   rM   rH   zlist[tuple[str, str]])r(   z$WSGIEnvironment | WSGIRequest | Noner)   rM   rH   r   )r(   r
   r:   r	   rH   zt.Iterable[bytes])rD   
__module____qualname____doc__r   __annotations__r   r   propertyr#   r*   r.   r1   r6   r;   r@   rE   __classcell__r   s   @r   r   r   C   s-    D*"K" #'$(!! "! 
	! A A +/)-''' '' 
	'  +/)-
'
 '
 
	
  +/)->'> '> 
	> 9=)-O5O 'O 
	O,
1&
18E
1	
19@r   r   c                      e Zd ZdZdZdZy)
BadRequestz*400* `Bad Request`

    Raise if the browser sends something to the application the application
    or server cannot handle.
    i  zLThe browser (or proxy) sent a request that this server could not understand.NrD   rO   rP   rQ   r   r   r0   r   r   rW   rW      s     D	 r   rW   c                  z     e Zd ZdZej
                  ZdZdd fdZe	dd       Zej                  d	d       Z xZS )
BadRequestKeyErrorzAn exception that is used to signal both a :exc:`KeyError` and a
    :exc:`BadRequest`. Used by many of the datastructures.
    Fc                    t        |   |i | |t        j                  |        y t        j                  | |       y r   )r   r   KeyError)r   argargskwargsr   s       r   r   zBadRequestKeyError.__init__   s8    $)&);d#dC(r   c                    | j                   r5| j                   dt        j                   dt        j	                  |        S | j                  S )Nr&   r>   )show_exception_descriptionr\   rD   r@   )r   s    r   r   zBadRequestKeyError.description   sP    $$%R$$%R(8(8(>'?A
    r   c                    || _         y r   )rb   )r   values     r   r   zBadRequestKeyError.description   s
    !r   r   )r]   zobject | Noner^   t.Anyr_   re   rJ   )rd   rK   rH   rI   )rD   rO   rP   rQ   rW   r   rb   ra   r   rS   setterrT   rU   s   @r   rZ   rZ      sO     ))L N) ! ! " "r   rZ   c                      e Zd ZdZy)ClientDisconnecteda)  Internal exception that is raised if Werkzeug detects a disconnected
    client.  Since the client is already gone at that point attempting to
    send the error message to the client might not work and might ultimately
    result in another exception in the server.  Mainly this is here so that
    it is silenced by default as far as Werkzeug is concerned.

    Since disconnections cannot be reliably detected and are unspecified
    by WSGI to a large extent this might or might not be raised if a client
    is gone.

    .. versionadded:: 0.8
    NrD   rO   rP   rQ   r0   r   r   rh   rh      s    r   rh   c                      e Zd ZdZy)SecurityErrorzRaised if something triggers a security error.  This is otherwise
    exactly like a bad request error.

    .. versionadded:: 0.9
    Nri   r0   r   r   rk   rk      s    r   rk   c                      e Zd ZdZy)BadHostzSRaised if the submitted host is badly formatted.

    .. versionadded:: 0.11.2
    Nri   r0   r   r   rm   rm      s    r   rm   c                  ^     e Zd ZdZdZdZ	 	 	 d	 	 	 	 	 	 	 d fdZ	 	 d	 	 	 	 	 d	 fdZ xZS )
Unauthorizedaz  *401* ``Unauthorized``

    Raise if the user is not authorized to access a resource.

    The ``www_authenticate`` argument should be used to set the
    ``WWW-Authenticate`` header. This is used for HTTP basic auth and
    other schemes. Use :class:`~werkzeug.datastructures.WWWAuthenticate`
    to create correctly formatted values. Strictly speaking a 401
    response is invalid if it doesn't provide at least one value for
    this header, although real clients typically don't care.

    :param description: Override the default message used for the body
        of the response.
    :param www-authenticate: A single value, or list of values, for the
        WWW-Authenticate header(s).

    .. versionchanged:: 2.0
        Serialize multiple ``www_authenticate`` items into multiple
        ``WWW-Authenticate`` headers, rather than joining them
        into a single value, for better interoperability.

    .. versionchanged:: 0.15.3
        If the ``www_authenticate`` argument is not set, the
        ``WWW-Authenticate`` header is not set.

    .. versionchanged:: 0.15.3
        The ``response`` argument was restored.

    .. versionchanged:: 0.15.1
        ``description`` was moved back as the first argument, restoring
         its previous position.

    .. versionchanged:: 0.15.0
        ``www_authenticate`` was added as the first argument, ahead of
        ``description``.
    i  zThe server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.c                ^    t         |   ||       ddlm} t	        ||      r|f}|| _        y )Nr   r   )r   r   datastructuresr   
isinstancewww_authenticate)r   r   r   rs   r   r   s        r   r   zUnauthorized.__init__+  s3     	h/3&8 02 0r   c                    t         |   ||      }| j                  r"|j                  d | j                  D               |S )Nc              3  6   K   | ]  }d t        |      f  yw)zWWW-AuthenticateN)rK   ).0xs     r   	<genexpr>z+Unauthorized.get_headers.<locals>.<genexpr>A  s     WA.A7Ws   )r   r1   rs   extendr   r(   r)   r5   r   s       r   r1   zUnauthorized.get_headers:  s<    
 '%gu5  NNWAVAVWWr   NNN)r   r   r   rG   rs   z6None | (WWWAuthenticate | t.Iterable[WWWAuthenticate])rH   rI   rF   rN   	rD   rO   rP   rQ   r   r   r   r1   rT   rU   s   @r   ro   ro      s    #J D	3  #'$(SW	11 "1 Q	1
 
1" +/)-' ' 
	 r   ro   c                      e Zd ZdZdZdZy)	Forbiddenz*403* `Forbidden`

    Raise if the user doesn't have the permission for the requested resource
    but was authenticated.
    i  zzYou don't have the permission to access the requested resource. It is either read-protected or not readable by the server.NrX   r0   r   r   r~   r~   E       D	 r   r~   c                      e Zd ZdZdZdZy)NotFoundzQ*404* `Not Found`

    Raise if a resource does not exist and never existed.
    i  zxThe requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.NrX   r0   r   r   r   r   T  s    
 D	F r   r   c                  ^     e Zd ZdZdZdZ	 	 	 d	 	 	 	 	 	 	 d fdZ	 	 d	 	 	 	 	 d	 fdZ xZS )
MethodNotAlloweda  *405* `Method Not Allowed`

    Raise if the server used a method the resource does not handle.  For
    example `POST` if the resource is view only.  Especially useful for REST.

    The first argument for this exception should be a list of allowed methods.
    Strictly speaking the response would be invalid if you don't provide valid
    methods in the header which you can do with that list.
    i  z0The method is not allowed for the requested URL.c                6    t         |   ||       || _        y)zkTakes an optional list of valid http methods
        starting with werkzeug 0.3 the list will be mandatory.r   r   N)r   r   valid_methods)r   r   r   r   r   s       r   r   zMethodNotAllowed.__init__o  s     	[8D*r   c                    t         |   ||      }| j                  r,|j                  ddj	                  | j                        f       |S )NAllowz, )r   r1   r   appendjoinrz   s       r   r1   zMethodNotAllowed.get_headersz  sD    
 '%gu5NNGTYYt/A/A%BCDr   r{   )r   zt.Iterable[str] | Noner   r   r   rG   rH   rI   rF   rN   r|   rU   s   @r   r   r   a  sx     DDK 15"&$(		+-	+  	+ "		+
 
	+ +/)-' ' 
	 r   r   c                      e Zd ZdZdZdZy)NotAcceptablez*406* `Not Acceptable`

    Raise if the server can't return any content conforming to the
    `Accept` headers of the client.
    i  zThe resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.NrX   r0   r   r   r   r     s     D	( r   r   c                      e Zd ZdZdZdZy)RequestTimeoutz?*408* `Request Timeout`

    Raise to signalize a timeout.
    i  zqThe server closed the network connection because the browser didn't finish the request within the specified time.NrX   r0   r   r   r   r     s    
 D	@ r   r   c                      e Zd ZdZdZdZy)Conflictz*409* `Conflict`

    Raise to signal that a request cannot be completed because it conflicts
    with the current state on the server.

    .. versionadded:: 0.7
    i  z~A conflict happened while processing the request. The resource might have been modified while the request was being processed.NrX   r0   r   r   r   r     s     D	 r   r   c                      e Zd ZdZdZdZy)Goneza*410* `Gone`

    Raise if a resource existed previously and went away without new location.
    i  zThe requested URL is no longer available on this server and there is no forwarding address. If you followed a link from a foreign page, please contact the author of this page.NrX   r0   r   r   r   r     s    
 D	A r   r   c                      e Zd ZdZdZdZy)LengthRequiredz*411* `Length Required`

    Raise if the browser submitted data but no ``Content-Length`` header which
    is required for the kind of processing the server does.
    i  zOA request with this method requires a valid <code>Content-Length</code> header.NrX   r0   r   r   r   r     s     D	  r   r   c                      e Zd ZdZdZdZy)PreconditionFailedz*412* `Precondition Failed`

    Status code used in combination with ``If-Match``, ``If-None-Match``, or
    ``If-Unmodified-Since``.
    i  zGThe precondition on the request for the URL failed positive evaluation.NrX   r0   r   r   r   r     s     DQ r   r   c                      e Zd ZdZdZdZy)RequestEntityTooLargez~*413* `Request Entity Too Large`

    The status code one should return if the data submitted exceeded a given
    limit.
    i  z6The data value transmitted exceeds the capacity limit.NrX   r0   r   r   r   r     s     DJKr   r   c                      e Zd ZdZdZdZy)RequestURITooLargezI*414* `Request URI Too Large`

    Like *413* but for too long URLs.
    i  zlThe length of the requested URL exceeds the capacity limit for this server. The request cannot be processed.NrX   r0   r   r   r   r     s    
 D	9 r   r   c                      e Zd ZdZdZdZy)UnsupportedMediaTypez*415* `Unsupported Media Type`

    The status code returned if the server is unable to handle the media type
    the client transmitted.
    i  zFThe server does not support the media type transmitted in the request.NrX   r0   r   r   r   r     s     DP r   r   c                  d     e Zd ZdZdZdZ	 	 	 	 d	 	 	 	 	 	 	 	 	 d fdZ	 	 d	 	 	 	 	 d	 fdZ xZS )
RequestedRangeNotSatisfiablez~*416* `Requested Range Not Satisfiable`

    The client asked for an invalid part of the file.

    .. versionadded:: 0.7
    i  z.The server cannot provide the requested range.c                D    t         |   ||       || _        || _        y)z^Takes an optional `Content-Range` header value based on ``length``
        parameter.
        r   N)r   r   lengthunits)r   r   r   r   r   r   s        r   r   z%RequestedRangeNotSatisfiable.__init__  s%     	[8D
r   c                    t         |   ||      }| j                  ,|j                  d| j                   d| j                   f       |S )NzContent-Rangez */)r   r1   r   r   r   rz   s       r   r1   z(RequestedRangeNotSatisfiable.get_headers  sI    
 '%gu5;;"NNO

|3t{{m-LMNr   )NbytesNN)
r   r   r   rK   r   r   r   rG   rH   rI   rF   rN   r|   rU   s   @r   r   r     s     DBK ""&$(   	
 " 
  +/)-' ' 
	 r   r   c                      e Zd ZdZdZdZy)ExpectationFailedz*417* `Expectation Failed`

    The server cannot meet the requirements of the Expect request-header.

    .. versionadded:: 0.7
    i  z?The server could not meet the requirements of the Expect headerNrX   r0   r   r   r   r   %  s     DSKr   r   c                      e Zd ZdZdZdZy)	ImATeapotz*418* `I'm a teapot`

    The server should return this if it is a teapot and someone attempted
    to brew coffee with it.

    .. versionadded:: 0.7
    i  z-This server is a teapot, not a coffee machineNrX   r0   r   r   r   r   1       DAKr   r   c                      e Zd ZdZdZdZy)MisdirectedRequestz421 Misdirected Request

    Indicates that the request was directed to a server that is not able to
    produce a response.

    .. versionadded:: 3.1
    i  z-The server is not able to produce a response.NrX   r0   r   r   r   r   >  r   r   r   c                      e Zd ZdZdZdZy)UnprocessableEntityz|*422* `Unprocessable Entity`

    Used if the request is well formed, but the instructions are otherwise
    incorrect.
    i  zQThe request was well-formed but was unable to be followed due to semantic errors.NrX   r0   r   r   r   r   K  s     D	 r   r   c                      e Zd ZdZdZdZy)LockedzO*423* `Locked`

    Used if the resource that is being accessed is locked.
    i  z.The resource that is being accessed is locked.NrX   r0   r   r   r   r   Y  s    
 DBKr   r   c                      e Zd ZdZdZdZy)FailedDependencyz*424* `Failed Dependency`

    Used if the method could not be performed on the resource
    because the requested action depended on another action and that action failed.
    i  zThe method could not be performed on the resource because the requested action depended on another action and that action failed.NrX   r0   r   r   r   r   c  r   r   r   c                      e Zd ZdZdZdZy)PreconditionRequireda  *428* `Precondition Required`

    The server requires this request to be conditional, typically to prevent
    the lost update problem, which is a race condition between two or more
    clients attempting to update a resource through PUT or DELETE. By requiring
    each client to include a conditional header ("If-Match" or "If-Unmodified-
    Since") with the proper value retained from a recent GET request, the
    server ensures that each client has at least seen the previous revision of
    the resource.
    i  zZThis request is required to be conditional; try using "If-Match" or "If-Unmodified-Since".NrX   r0   r   r   r   r   r  s    	 D	0 r   r   c                  V     e Zd ZdZ	 	 	 d	 	 	 	 	 	 	 d fdZ	 	 d	 	 	 	 	 d fdZ xZS )_RetryAfterzAdds an optional ``retry_after`` parameter which will set the
    ``Retry-After`` header. May be an :class:`int` number of seconds or
    a :class:`~datetime.datetime`.
    c                4    t         |   ||       || _        y r   )r   r   retry_after)r   r   r   r   r   s       r   r   z_RetryAfter.__init__  s     	h/&r   c                    t         |   ||      }| j                  r[t        | j                  t              rddlm}  || j                        }nt        | j                        }|j                  d|f       |S )Nr   )	http_datezRetry-After)	r   r1   r   rr   r   r!   r   rK   r   )r   r(   r)   r5   r   rd   r   s         r   r1   z_RetryAfter.get_headers  sh    
 '%gu5$**H5+!$"2"23D,,-NNM512r   r{   )r   r   r   rG   r   zdatetime | int | NonerH   rI   rF   rN   )rD   rO   rP   rQ   r   r1   rT   rU   s   @r   r   r     sl     #'$(-1	'' "' +	'
 
' +/)-' ' 
	 r   r   c                      e Zd ZdZdZdZy)TooManyRequestsaO  *429* `Too Many Requests`

    The server is limiting the rate at which this user receives
    responses, and this request exceeds that rate. (The server may use
    any convenient method to identify users and their request rates).
    The server may include a "Retry-After" header to indicate how long
    the user should wait before retrying.

    :param retry_after: If given, set the ``Retry-After`` header to this
        value. May be an :class:`int` number of seconds or a
        :class:`~datetime.datetime`.

    .. versionchanged:: 1.0
        Added ``retry_after`` parameter.
    i  zBThis user has exceeded an allotted request count. Try again later.NrX   r0   r   r   r   r     s      DVKr   r   c                      e Zd ZdZdZdZy)RequestHeaderFieldsTooLargez*431* `Request Header Fields Too Large`

    The server refuses to process the request because the header fields are too
    large. One or more individual fields may be too large, or the set of all
    headers is too large.
    i  z3One or more header fields exceeds the maximum size.NrX   r0   r   r   r   r     s     DGKr   r   c                      e Zd ZdZdZdZy)UnavailableForLegalReasonsz*451* `Unavailable For Legal Reasons`

    This status code indicates that the server is denying access to the
    resource as a consequence of a legal demand.
    i  zUnavailable for legal reasons.NrX   r0   r   r   r   r     s     D2Kr   r   c                  B     e Zd ZdZdZdZ	 	 	 d	 	 	 	 	 	 	 d fdZ xZS )InternalServerErrorz*500* `Internal Server Error`

    Raise if an internal server error occurred.  This is a good fallback if an
    unknown error occurred in the dispatcher.

    .. versionchanged:: 1.0.0
        Added the :attr:`original_exception` attribute.
    i  zThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.c                6    || _         t        | 	  ||       y )Nr   )original_exceptionr   r   )r   r   r   r   r   s       r   r   zInternalServerError.__init__  s     #5[8Dr   r{   )r   r   r   rG   r   zBaseException | NonerH   rI   )rD   rO   rP   rQ   r   r   r   rT   rU   s   @r   r   r     sZ     D	1  #'$(37	
E
E "
E 1	
E
 

E 
Er   r   c                      e Zd ZdZdZdZy)NotImplementedzt*501* `Not Implemented`

    Raise if the application does not support the action requested by the
    browser.
    i  z@The server does not support the action requested by the browser.NrX   r0   r   r   r   r     s     DTKr   r   c                      e Zd ZdZdZdZy)
BadGatewayz*502* `Bad Gateway`

    If you do proxying in your application you should return this status code
    if you received an invalid response from the upstream server it accessed
    in attempting to fulfill the request.
    i  zFThe proxy server received an invalid response from an upstream server.NrX   r0   r   r   r   r     s     DP r   r   c                      e Zd ZdZdZdZy)ServiceUnavailableab  *503* `Service Unavailable`

    Status code you should return if a service is temporarily
    unavailable.

    :param retry_after: If given, set the ``Retry-After`` header to this
        value. May be an :class:`int` number of seconds or a
        :class:`~datetime.datetime`.

    .. versionchanged:: 1.0
        Added ``retry_after`` parameter.
    i  zThe server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.NrX   r0   r   r   r   r     s     D	 r   r   c                      e Zd ZdZdZdZy)GatewayTimeoutzt*504* `Gateway Timeout`

    Status code you should return if a connection to an upstream server
    times out.
    i  z/The connection to an upstream server timed out.NrX   r0   r   r   r   r   !  s     DCKr   r   c                      e Zd ZdZdZdZy)HTTPVersionNotSupportedzw*505* `HTTP Version Not Supported`

    The server does not support the HTTP protocol version used in the request.
    i  zJThe server does not support the HTTP protocol version used in the request.NrX   r0   r   r   r   r   ,  s    
 DT r   r   zdict[int, type[HTTPException]]default_exceptionsc                 $   t               j                         D ]d  } 	 t        | t              }|r| j
                  #t        j                  | j
                  d       }|t        | |      rR| t        | j
                  <   f y # t        $ r d}Y aw xY w)NF)globalsvalues
issubclassr   	TypeErrorr   r   r"   )objis_http_exceptionold_objs      r   _find_exceptionsr   ;  s    y! 
+	& *3 > !CHH$4$((48:c7#;'*388$
+  	& %	&s   BBBc                  @    e Zd ZdZ	 	 d	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZy)AborteraY  When passed a dict of code -> exception items it can be used as
    callable that raises exceptions.  If the first argument to the
    callable is an integer it will be looked up in the mapping, if it's
    a WSGI application it will be raised in a proxy exception.

    The rest of the arguments are forwarded to the exception constructor.
    Nc                p    |t         }t        |      | _        || j                  j                  |       y y r   )r   dictmappingupdate)r   r   extras      r   r   zAborter.__init__V  s6    
 ?(GG}LL& r   c                    ddl m} t        ||      rt        |      || j                  vrt        d|       | j                  |   |i |)Nr   r   )r   zno exception for )sansio.responser   rr   r   r   LookupError)r   r   r^   r_   r   s        r   r;   zAborter.__call__a  sV     	.dH%..t||# 1$:;; dll4 $1&11r   rF   )r   %dict[int, type[HTTPException]] | Noner   r   rH   rI   )r   int | Responser^   re   r_   re   rH   
t.NoReturn)rD   rO   rP   rQ   r   r;   r0   r   r   r   r   M  sU     :>7;	'6	' 5	' 
		'2"2+02<A2	2r   r   c                "    t        | g|i | y)at  Raises an :py:exc:`HTTPException` for the given status code or WSGI
    application.

    If a status code is given, it will be looked up in the list of
    exceptions and will raise that exception.  If passed a WSGI application,
    it will wrap it in a proxy WSGI exception and raise that::

       abort(404)  # 404 Not Found
       abort(Response('Hello World'))

    N)_aborter)statusr^   r_   s      r   abortr   o  s     V%d%f%r   r   )rH   rI   )r   r   r^   re   r_   re   rH   r   )ErQ   
__future__r   typingr8   r   
markupsafer   r   	_internalr   TYPE_CHECKING_typeshed.wsgir	   r
   rq   r   r   r   wrappers.requestr   WSGIRequestr3   r4   	Exceptionr   rW   r\   rZ   rh   rk   rm   ro   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rR   r   r   r   r   r0   r   r   <module>r      sR  ,\ #     #??,./)8;i@I i@X "X "D J j E= EP 
} 
!} !HM  
] 
} "= ] 
 
KM K
 

= 
!= !H	T 	T
B 
B
B 
B- C] C} = & -  FWk W*	H- 	H3 3E- E<U] U  ,D] D	m 	 68 2 7+  2 2D& I' r   