Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for RequestValidationError (0.24 sec)

  1. docs/en/docs/tutorial/handling-errors.md

    ### Override request validation exceptions
    
    When a request contains invalid data, **FastAPI** internally raises a `RequestValidationError`.
    
    And it also includes a default exception handler for it.
    
    To override it, import the `RequestValidationError` and use it with `@app.exception_handler(RequestValidationError)` to decorate the exception handler.
    
    The exception handler will receive a `Request` and the exception.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. fastapi/exception_handlers.py

    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError
    from fastapi.utils import is_body_allowed_for_status_code
    from fastapi.websockets import WebSocket
    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.responses import JSONResponse, Response
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/handling-errors.md

    Wenn ein Request ungültige Daten enthält, löst **FastAPI** intern einen `RequestValidationError` aus.
    
    Und bietet auch einen Default-Exceptionhandler dafür.
    
    Um diesen zu überschreiben, importieren Sie den `RequestValidationError` und verwenden Sie ihn in `@app.exception_handler(RequestValidationError)`, um Ihren Exceptionhandler zu dekorieren.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:28:29 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/handling-errors.md

    Когда запрос содержит недопустимые данные, **FastAPI** внутренне вызывает ошибку `RequestValidationError`.
    
    А также включает в себя обработчик исключений по умолчанию.
    
    Чтобы переопределить его, импортируйте `RequestValidationError` и используйте его с `@app.exception_handler(RequestValidationError)` для создания обработчика исключений.
    
    Обработчик исключения получит объект `Request` и исключение.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.5K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/handling-errors.md

    ## Sobrescreva exceções de validação da requisição
    
    Quando a requisição contém dados inválidos, **FastAPI** internamente lança para o `RequestValidationError`.
    
    Para sobrescrevê-lo, importe o `RequestValidationError` e use-o com o `@app.exception_handler(RequestValidationError)` para decorar o manipulador de exceções.
    
    ```Python hl_lines="2  14-16"
    {!../../../docs_src/handling_errors/tutorial004.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/handling-errors.md

    触发 `HTTPException` 或请求无效数据时,这些处理器返回默认的 JSON 响应结果。
    
    不过,也可以使用自定义处理器覆盖默认异常处理器。
    
    ### 覆盖请求验证异常
    
    请求中包含无效数据时,**FastAPI** 内部会触发 `RequestValidationError`。
    
    该异常也内置了默认异常处理器。
    
    覆盖默认异常处理器时需要导入 `RequestValidationError`,并用 `@app.excption_handler(RequestValidationError)` 装饰异常处理器。
    
    这样,异常处理器就可以接收 `Request` 与异常。
    
    ```Python hl_lines="2  14-16"
    {!../../../docs_src/handling_errors/tutorial004.py!}
    
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/handling-errors.md

    👆 💪 🔐 👫 ⚠ 🐕‍🦺 ⏮️ 👆 👍.
    
    ### 🔐 📨 🔬 ⚠
    
    🕐❔ 📨 🔌 ❌ 📊, **FastAPI** 🔘 🤚 `RequestValidationError`.
    
    & ⚫️ 🔌 🔢 ⚠ 🐕‍🦺 ⚫️.
    
    🔐 ⚫️, 🗄 `RequestValidationError` & ⚙️ ⚫️ ⏮️ `@app.exception_handler(RequestValidationError)` 🎀 ⚠ 🐕‍🦺.
    
    ⚠ 🐕‍🦺 🔜 📨 `Request` & ⚠.
    
    ```Python hl_lines="2  14-16"
    {!../../../docs_src/handling_errors/tutorial004.py!}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  8. docs/ja/docs/tutorial/handling-errors.md

    これらの例外ハンドラを独自のものでオーバーライドすることができます。
    
    ### リクエスト検証の例外のオーバーライド
    
    リクエストに無効なデータが含まれている場合、**FastAPI** は内部的に`RequestValidationError`を発生させます。
    
    また、そのためのデフォルトの例外ハンドラも含まれています。
    
    これをオーバーライドするには`RequestValidationError`をインポートして`@app.exception_handler(RequestValidationError)`と一緒に使用して例外ハンドラをデコレートします。
    
    この例外ハンドラは`Requset`と例外を受け取ります。
    
    ```Python hl_lines="2 14 15 16"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/custom-request-and-route.md

    ## Accessing the request body in an exception handler
    
    !!! tip
        To solve this same problem, it's probably a lot easier to use the `body` in a custom handler for `RequestValidationError` ([Handling Errors](../tutorial/handling-errors.md#use-the-requestvalidationerror-body){.internal-link target=_blank}).
    
        But this example is still valid and it shows how to interact with the internal components.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  10. docs/de/docs/how-to/custom-request-and-route.md

    !!! tip "Tipp"
        Um dasselbe Problem zu lösen, ist es wahrscheinlich viel einfacher, den `body` in einem benutzerdefinierten Handler für `RequestValidationError` zu verwenden ([Fehlerbehandlung](../tutorial/handling-errors.md#den-requestvalidationerror-body-verwenden){.internal-link target=_blank}).
    
        Dieses Beispiel ist jedoch immer noch gültig und zeigt, wie mit den internen Komponenten interagiert wird.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:18:23 GMT 2024
    - 5.2K bytes
    - Viewed (0)
Back to top