Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 26 for exception_handlers (0.09 seconds)

  1. fastapi/applications.py

                strict_content_type=strict_content_type,
            )
            self.exception_handlers: dict[
                Any, Callable[[Request, Any], Response | Awaitable[Response]]
            ] = {} if exception_handlers is None else dict(exception_handlers)
            self.exception_handlers.setdefault(HTTPException, http_exception_handler)
            self.exception_handlers.setdefault(
                RequestValidationError, request_validation_exception_handler
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Apr 01 16:16:24 GMT 2026
    - 178.6K bytes
    - Click Count (0)
  2. docs_src/handling_errors/tutorial006_py310.py

    from fastapi import FastAPI, HTTPException
    from fastapi.exception_handlers import (
        http_exception_handler,
        request_validation_exception_handler,
    )
    from fastapi.exceptions import RequestValidationError
    from starlette.exceptions import HTTPException as StarletteHTTPException
    
    app = FastAPI()
    
    
    @app.exception_handler(StarletteHTTPException)
    async def custom_http_exception_handler(request, exc):
        print(f"OMG! An HTTP error!: {repr(exc)}")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 928 bytes
    - Click Count (0)
  3. docs/de/docs/tutorial/handling-errors.md

    ```Python
    from starlette.exceptions import HTTPException as StarletteHTTPException
    ```
    
    ### Die Exceptionhandler von **FastAPI** wiederverwenden { #reuse-fastapis-exception-handlers }
    
    Wenn Sie die Exception zusammen mit den gleichen Default-Exceptionhandlern von **FastAPI** verwenden möchten, können Sie die Default-Exceptionhandler aus `fastapi.exception_handlers` importieren und wiederverwenden:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  4. docs/ru/docs/tutorial/handling-errors.md

    Если вы хотите использовать исключение вместе с теми же обработчиками исключений по умолчанию из **FastAPI**, вы можете импортировать и повторно использовать обработчики исключений по умолчанию из `fastapi.exception_handlers`:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 14K bytes
    - Click Count (0)
  5. docs/fr/docs/tutorial/handling-errors.md

    Si vous souhaitez utiliser l'exception avec les mêmes gestionnaires d'exception par défaut de **FastAPI**, vous pouvez importer et réutiliser les gestionnaires d'exception par défaut depuis `fastapi.exception_handlers` :
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 10K bytes
    - Click Count (0)
  6. docs/es/docs/tutorial/handling-errors.md

    Si quieres usar la excepción junto con los mismos manejadores de excepciones predeterminados de **FastAPI**, puedes importar y reutilizar los manejadores de excepciones predeterminados de `fastapi.exception_handlers`:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 9.6K bytes
    - Click Count (0)
  7. docs/pt/docs/tutorial/handling-errors.md

    Se você quer usar a exceção em conjunto com o mesmo manipulador de exceção *default* do **FastAPI**, você pode importar e re-usar esses manipuladores de exceção do `fastapi.exception_handlers`:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  8. docs/uk/docs/tutorial/handling-errors.md

    Якщо ви хочете використовувати виключення разом із такими ж обробниками виключень за замовчуванням, як у **FastAPI**, ви можете імпортувати та повторно використати обробники виключень за замовчуванням із `fastapi.exception_handlers`:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 13.9K bytes
    - Click Count (0)
  9. docs/tr/docs/tutorial/handling-errors.md

    Exception’ı, **FastAPI**’nin aynı varsayılan exception handler’larıyla birlikte kullanmak isterseniz, varsayılan exception handler’ları `fastapi.exception_handlers` içinden import edip yeniden kullanabilirsiniz:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 9.7K bytes
    - Click Count (0)
  10. docs/zh/docs/tutorial/handling-errors.md

    ```Python
    from starlette.exceptions import HTTPException as StarletteHTTPException
    ```
    
    ### 复用 **FastAPI** 的异常处理器 { #reuse-fastapis-exception-handlers }
    
    如果你想在自定义处理后仍复用 **FastAPI** 的默认异常处理器,可以从 `fastapi.exception_handlers` 导入并复用这些默认处理器:
    
    {* ../../docs_src/handling_errors/tutorial006_py310.py hl[2:5,15,21] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 8.2K bytes
    - Click Count (0)
Back to Top