Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for raise (0.15 sec)

  1. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

        Note over client,tasks: Can raise exception for dependency, handled after response is sent
        Note over client,operation: Can raise HTTPException and can change the response
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise
            dep -->> handler: Raise HTTPException
            handler -->> client: HTTP error response
            dep -->> dep: Raise other exception
        end
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

        Note over client,operation: Can raise exceptions, including HTTPException
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise Exception
            dep -->> handler: Raise Exception
            handler -->> client: HTTP error response
        end
        dep ->> operation: Run dependency, e.g. DB session
        opt raise
            operation -->> dep: Raise Exception (e.g. HTTPException)
            opt handle
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/handling-errors.md

    {!../../../docs_src/handling_errors/tutorial001.py!}
    ```
    
    ### Raise an `HTTPException` in your code
    
    `HTTPException` is a normal Python exception with additional data relevant for APIs.
    
    Because it's a Python exception, you don't `return` it, you `raise` it.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/handling-errors.md

    โžก๏ธ ๐Ÿ’ฌ ๐Ÿ‘† โœ”๏ธ ๐Ÿ›ƒ โš  `UnicornException` ๐Ÿ‘ˆ ๐Ÿ‘† (โš–๏ธ ๐Ÿ—ƒ ๐Ÿ‘† โš™๏ธ) ๐Ÿ’ช `raise`.
    
    & ๐Ÿ‘† ๐Ÿ’š ๐Ÿต ๐Ÿ‘‰ โš  ๐ŸŒ โฎ๏ธ FastAPI.
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐Ÿ›ƒ โš  ๐Ÿ•โ€๐Ÿฆบ โฎ๏ธ `@app.exception_handler()`:
    
    ```Python hl_lines="5-7  13-18  24"
    {!../../../docs_src/handling_errors/tutorial003.py!}
    ```
    
    ๐Ÿ“ฅ, ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ“จ `/unicorns/yolo`, *โžก ๐Ÿ› ๏ธ* ๐Ÿ”œ `raise` `UnicornException`.
    
    โœ‹๏ธ โšซ๏ธ ๐Ÿ”œ ๐Ÿต `unicorn_exception_handler`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/handling-errors.md

    ใ‚ใชใŸ๏ผˆใพใŸใฏไฝฟ็”จใ—ใฆใ„ใ‚‹ใƒฉใ‚คใƒ–ใƒฉใƒช๏ผ‰ใŒ`raise`ใ™ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใชใ„ใ‚ซใ‚นใ‚ฟใƒ ไพ‹ๅค–`UnicornException`ใŒใ‚ใ‚‹ใจใ—ใพใ—ใ‚‡ใ†ใ€‚
    
    ใใ—ใฆใ€ใ“ใฎไพ‹ๅค–ใ‚’FastAPIใงใ‚ฐใƒญใƒผใƒใƒซใซๅ‡ฆ็†ใ—ใŸใ„ใจๆ€ใ„ใพใ™ใ€‚
    
    ใ‚ซใ‚นใ‚ฟใƒ ไพ‹ๅค–ใƒใƒณใƒ‰ใƒฉใ‚’`@app.exception_handler()`ใง่ฟฝๅŠ ใ™ใ‚‹ใ“ใจใŒใงใใพใ™:
    
    ```Python hl_lines="5 6 7  13 14 15 16 17 18  24"
    {!../../../docs_src/handling_errors/tutorial003.py!}
    ```
    
    ใ“ใ“ใงใ€`/unicorns/yolo`ใ‚’ใƒชใ‚ฏใ‚จใ‚นใƒˆใ™ใ‚‹ใจใ€*path operation*ใฏ`UnicornException`ใ‚’`raise`ใ—ใพใ™ใ€‚
    
    ใ—ใ‹ใ—ใ€ใ“ใ‚Œใฏ`unicorn_exception_handler`ใงๅ‡ฆ็†ใ•ใ‚Œใพใ™ใ€‚
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  6. docs/em/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐ŸŽ ๐Ÿ”— *๐Ÿ”ข* ๐Ÿ‘† โš™๏ธ ๐Ÿ›Ž.
    
    ### ๐Ÿ”— ๐Ÿ“„
    
    ๐Ÿ‘ซ ๐Ÿ’ช ๐Ÿ“ฃ ๐Ÿ“จ ๐Ÿ“„ (๐Ÿ’– ๐ŸŽš) โš–๏ธ ๐ŸŽ ๐ŸŽง-๐Ÿ”—:
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ### ๐Ÿคš โš 
    
    ๐Ÿ‘ซ ๐Ÿ”— ๐Ÿ’ช `raise` โš , ๐ŸŽ ๐Ÿ˜ ๐Ÿ”—:
    
    ```Python hl_lines="8  13"
    {!../../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ### ๐Ÿ“จ ๐Ÿ’ฒ
    
    & ๐Ÿ‘ซ ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ’ฒ โš–๏ธ ๐Ÿšซ, ๐Ÿ’ฒ ๐Ÿ† ๐Ÿšซ โš™๏ธ.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/handling-errors.md

    ```
    
    ### ่งฆๅ‘ `HTTPException`
    
    `HTTPException` ๆ˜ฏ้ขๅค–ๅŒ…ๅซไบ†ๅ’Œ API ๆœ‰ๅ…ณๆ•ฐๆฎ็š„ๅธธ่ง„ Python ๅผ‚ๅธธใ€‚
    
    ๅ› ไธบๆ˜ฏ Python ๅผ‚ๅธธ๏ผŒๆ‰€ไปฅไธ่ƒฝ `return`๏ผŒๅช่ƒฝ `raise`ใ€‚
    
    ๅฆ‚ๅœจ่ฐƒ็”จ*่ทฏๅพ„ๆ“ไฝœๅ‡ฝๆ•ฐ*้‡Œ็š„ๅทฅๅ…ทๅ‡ฝๆ•ฐๆ—ถ๏ผŒ่งฆๅ‘ไบ† `HTTPException`๏ผŒFastAPI ๅฐฑไธๅ†็ปง็ปญๆ‰ง่กŒ*่ทฏๅพ„ๆ“ไฝœๅ‡ฝๆ•ฐ*ไธญ็š„ๅŽ็ปญไปฃ็ ๏ผŒ่€Œๆ˜ฏ็ซ‹ๅณ็ปˆๆญข่ฏทๆฑ‚๏ผŒๅนถๆŠŠ `HTTPException` ็š„ HTTP ้”™่ฏฏๅ‘้€่‡ณๅฎขๆˆท็ซฏใ€‚
    
    ๅœจไป‹็ปไพ่ต–้กนไธŽๅฎ‰ๅ…จ็š„็ซ ่Š‚ไธญ๏ผŒๆ‚จๅฏไปฅไบ†่งฃๆ›ดๅคš็”จ `raise` ๅผ‚ๅธธไปฃๆ›ฟ `return` ๅ€ผ็š„ไผ˜ๅŠฟใ€‚
    
    ๆœฌไพ‹ไธญ๏ผŒๅฎขๆˆท็ซฏ็”จ `ID` ่ฏทๆฑ‚็š„ `item` ไธๅญ˜ๅœจๆ—ถ๏ผŒ่งฆๅ‘็Šถๆ€็ ไธบ `404` ็š„ๅผ‚ๅธธ๏ผš
    
    ```Python hl_lines="11"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

        !!! tip "ํŒ"
            ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด `Annotated`๊ฐ€ ๋‹ฌ๋ฆฐ ๋ฒ„์ „์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
    
        ```Python hl_lines="6  11"
        {!> ../../../docs_src/dependencies/tutorial006.py!}
        ```
    
    ### ์˜ค๋ฅ˜ ๋ฐœ์ƒ์‹œํ‚ค๊ธฐ
    
    ๋‹ค์Œ ์˜์กด์„ฑ์€ ๊ธฐ์กด ์˜์กด์„ฑ๊ณผ ๋™์ผํ•˜๊ฒŒ ์˜ˆ์™ธ๋ฅผ `raise`๋ฅผ ์ผ์œผํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
    
    === "Python 3.9+"
    
        ```Python hl_lines="10  15"
        {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="9  14"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Feb 11 13:49:45 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  9. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

        Note over client,tasks: Can raise exception for dependency, handled after response is sent
        Note over client,operation: Can raise HTTPException and can change the response
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise
            dep -->> handler: Raise HTTPException
            handler -->> client: HTTP error response
            dep -->> dep: Raise other exception
        end
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  10. docs/en/docs/reference/exceptions.md

    # Exceptions - `HTTPException` and `WebSocketException`
    
    These are the exceptions that you can raise to show errors to the client.
    
    When you raise an exception, as would happen with normal Python, the rest of the execution is aborted. This way you can raise these exceptions from anywhere in the code to abort a request and show the error to the client.
    
    You can use:
    
    * `HTTPException`
    * `WebSocketException`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 597 bytes
    - Viewed (0)
Back to top