Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Try (0.14 sec)

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

    ```Python hl_lines="5 6"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    !!! tip "豆知識"
        `async`や通常の関数を使用することができます。
    
        **FastAPI** は、通常の依存関係と同じように、それぞれで正しいことを行います。
    
    ## `yield`と`try`を持つ依存関係
    
    `yield`を持つ依存関係で`try`ブロックを使用した場合、その依存関係を使用した際に発生した例外を受け取ることになります。
    
    例えば、途中のどこかの時点で、別の依存関係や*path operation*の中で、データベーストランザクションを「ロールバック」したり、その他のエラーを作成したりするコードがあった場合、依存関係の中で例外を受け取ることになります。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

    !!! tip "Tipp"
        Sie können `async`hrone oder reguläre Funktionen verwenden.
    
        **FastAPI** wird bei jeder das Richtige tun, so wie auch bei normalen Abhängigkeiten.
    
    ## Eine Abhängigkeit mit `yield` und `try`.
    
    Wenn Sie einen `try`-Block in einer Abhängigkeit mit `yield` verwenden, empfangen Sie alle Exceptions, die bei Verwendung der Abhängigkeit geworfen wurden.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:10:29 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    ```Python hl_lines="5-6"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    !!! tip
        👆 💪 ⚙️ `async` ⚖️ 😐 🔢.
    
        **FastAPI** 🔜 ▶️️ 👜 ⏮️ 🔠, 🎏 ⏮️ 😐 🔗.
    
    ## 🔗 ⏮️ `yield` & `try`
    
    🚥 👆 ⚙️ `try` 🍫 🔗 ⏮️ `yield`, 👆 🔜 📨 🙆 ⚠ 👈 🚮 🕐❔ ⚙️ 🔗.
    
    🖼, 🚥 📟 ☝ 🖕, ➕1️⃣ 🔗 ⚖️ *➡ 🛠️*, ⚒ 💽 💵 "💾" ⚖️ ✍ 🙆 🎏 ❌, 👆 🔜 📨 ⚠ 👆 🔗.
    
    , 👆 💪 👀 👈 🎯 ⚠ 🔘 🔗 ⏮️ `except SomeException`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ```
    
    !!! tip
        You can use `async` or regular functions.
    
        **FastAPI** will do the right thing with each, the same as with normal dependencies.
    
    ## A dependency with `yield` and `try`
    
    If you use a `try` block in a dependency with `yield`, you'll receive any exception that was thrown when using the dependency.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

        Можно использовать как `async` так и обычные функции.
    
        **FastAPI** это корректно обработает, и в обоих случаях будет делать то же самое, что и с обычными зависимостями.
    
    ## Зависимость с `yield` и `try` одновременно
    
    Если использовать блок `try` в зависимости с `yield`, то будет получено всякое исключение, которое было выброшено при использовании зависимости.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 04:21:06 GMT 2024
    - 19.6K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    ```Python hl_lines="5-6"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    !!! tip "提示"
    
        您可以使用 `async` 或普通函数。
    
        **FastAPI** 会像处理普通依赖关系一样,对每个依赖关系做正确的处理。
    
    ## 同时包含了 `yield` 和 `try` 的依赖项
    
    如果在带有 `yield` 的依赖关系中使用 `try` 代码块,就会收到使用依赖关系时抛出的任何异常。
    
    例如,如果中间某个代码在另一个依赖中或在*路径操作*中使数据库事务 "回滚 "或产生任何其他错误,您就会在依赖中收到异常。
    
    因此,你可以使用 `except SomeException` 在依赖关系中查找特定的异常。
    
    同样,您也可以使用 `finally` 来确保退出步骤得到执行,无论是否存在异常。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K bytes
    - Viewed (0)
Back to top