Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 213 for raise (0.03 sec)

  1. 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`で処理されます。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  2. tests/test_custom_middleware_exception.py

                    return message  # pragma: no cover
    
                body_len = len(message.get("body", b""))
                received += body_len
                if received > self.max_content_size:
                    raise HTTPException(
                        422,
                        detail={
                            "name": "ContentSizeLimitExceeded",
                            "code": 999,
                            "message": "File limit exceeded",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 25 21:44:40 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  3. common/config/sass-lint.yml

    #########################
    ## Config for sass-lint
    #########################
    # Linter Options
    options:
      # Don't merge default rules
      merge-default-rules: false
      # Raise an error if more than 50 warnings are generated
      max-warnings: 500
    # Rule Configuration
    rules:
      attribute-quotes:
        - 2
        -
          include: false
      bem-depth: 2
      border-zero: 2
      brace-style: 2
      class-name-format: 2
      clean-import-paths: 2
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Sep 11 23:32:21 UTC 2019
    - 2K bytes
    - Viewed (0)
  4. docs/ja/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!}
    ```
    
    ### 戻り値
    
    そして、値を返すことも返さないこともできますが、値は使われません。
    
    つまり、すでにどこかで使っている通常の依存関係(値を返すもの)を再利用することができ、値は使われなくても依存関係は実行されます:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  5. 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!}
    ```
    
    ### 📨 💲
    
    & 👫 💪 📨 💲 ⚖️ 🚫, 💲 🏆 🚫 ⚙️.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/dependencies/dependencies-with-yield.md

    ### Sempre levante (`raise`) exceções em Dependências com `yield` e `except`
    
    Se você capturar uma exceção em uma dependência com `yield`, a menos que você esteja levantando outra `HTTPException` ou coisa parecida, você deveria relançar a exceção original.
    
    Você pode relançar a mesma exceção utilizando `raise`:
    
    //// tab | Python 3.9+
    
    ```Python hl_lines="17"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    ///
    
    ```Python hl_lines="6  11"
    {!> ../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ////
    
    ### Exceptions auslösen
    
    Die Abhängigkeiten können Exceptions `raise`n, genau wie normale Abhängigkeiten:
    
    //// tab | Python 3.9+
    
    ```Python hl_lines="10  15"
    {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
    ```
    
    ////
    
    //// tab | Python 3.8+
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  8. tests/delete_test.go

    		t.Errorf("failed to delete user, got error %v", err)
    	}
    
    	var result2 UserWithDelete
    	if err := DB.Table("deleted_users").First(&result2, user.ID).Error; !errors.Is(err, gorm.ErrRecordNotFound) {
    		t.Errorf("should raise record not found error, but got error %v", err)
    	}
    
    	var result3 UserWithDelete
    	if err := DB.Table("deleted_users").Unscoped().First(&result3, user.ID).Error; err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Oct 10 07:03:34 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    ///
    
    ```Python hl_lines="6  11"
    {!> ../../docs_src/dependencies/tutorial006.py!}
    ```
    
    ////
    
    ### Вызов исключений
    
    Зависимости из dependencies могут вызывать исключения с помощью `raise`, как и обычные зависимости:
    
    //// tab | Python 3.9+
    
    ```Python hl_lines="10  15"
    {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
    ```
    
    ////
    
    //// tab | Python 3.8+
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  10. docs/zh/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!}
    ```
    
    ### 返回值
    
    无论路径装饰器依赖项是否返回值,路径操作都不会使用这些值。
    
    因此,可以复用在其他位置使用过的、(能返回值的)普通依赖项,即使没有使用这个值,也会执行该依赖项:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.7K bytes
    - Viewed (0)
Back to top