src/flask/scaffold.py
def _get_exc_class_and_code(
        exc_class_or_code: t.Union[t.Type[Exception], int]
    ) -> t.Tuple[t.Type[Exception], t.Optional[int]]:
        """Get the exception class being handled. For HTTP status codes
        or ``HTTPException`` subclasses, return both the exception and
        status code.

        :param exc_class_or_code: Any exception class, or an HTTP status
            code as an integer.
        """
        exc_class: t.Type[Exception]
        if isinstance(exc_class_or_code, int):
            exc_class = default_exceptions[exc_class_or_code]
        else:
            exc_class = exc_class_or_code

        assert issubclass(
            exc_class, Exception
        ), "Custom exceptions must be subclasses of Exception."

        if issubclass(exc_class, HTTPException):
            return exc_class, exc_class.code
        else:
            return exc_class, None
Get the exception class being handled. For HTTP status codes
        or ``HTTPException`` subclasses, return both the exception and
        status code.

        :param exc_class_or_code: Any exception class, or an HTTP status
            code as an integer.
        
Get the exception class being handled. For HTTP status codes
or ``HTTPException`` subclasses, return both the exception and
status code.
Get the exception class being handled . For HTTP status codes or ` ` HTTPException ` ` subclasses return both the exception and status code .
def _get_exc_class_and_code(
        exc_class_or_code: t.Union[t.Type[Exception], int]
    ) -> t.Tuple[t.Type[Exception], t.Optional[int]]:
        exc_class: t.Type[Exception]
        if isinstance(exc_class_or_code, int):
            exc_class = default_exceptions[exc_class_or_code]
        else:
            exc_class = exc_class_or_code
        assert issubclass(
            exc_class, Exception
        ), "Custom exceptions must be subclasses of Exception."
        if issubclass(exc_class, HTTPException):
            return exc_class, exc_class.code
        else:
            return exc_class, None
def _get_exc_class_and_code ( exc_class_or_code : t . Union [ t . Type [ Exception ] , int ] ) -> t . Tuple [ t . Type [ Exception ] , t . Optional [ int ] ] : exc_class : t . Type [ Exception ] if isinstance ( exc_class_or_code , int ) : exc_class = default_exceptions [ exc_class_or_code ] else : exc_class = exc_class_or_code assert issubclass ( exc_class , Exception ) , "Custom exceptions must be subclasses of Exception." if issubclass ( exc_class , HTTPException ) : return exc_class , exc_class . code else : return exc_class , None
Get the exception class being handled.
Get the exception class being handled .
"""Get the exception class being handled. For HTTP status codes
        or ``HTTPException`` subclasses, return both the exception and
        status code.

        :param exc_class_or_code: Any exception class, or an HTTP status
            code as an integer.
        """
exc_class_or_code
t.Union[t.Type[Exception], int]
Any exception class, or an HTTP status
code as an integer.
Any exception class or an HTTP status code as an integer .