mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
* fix redirect language code prefixes * rename: cn -> zh, jp -> ja * remove hardcoded ja / zh references * remove hardcoded 'english' references * renamed variable names and dict keys to language agnostic names * fix: add missing language helper methods to PRAnalyzer - Add get_language_directory() method - Initialize source_language and target_languages from config - Fixes AttributeError when generating mixed PR errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * Refactor/language codes (#240) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp --------- Co-authored-by: Claude <noreply@anthropic.com> * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix/workflow source language references (#245) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> * fix * fix docs.json language codes * rename previous version docs: cn -> zh, jp -> ja * rm duplicate redirect entires --------- Co-authored-by: Claude <noreply@anthropic.com>
91 lines
4.5 KiB
Plaintext
91 lines
4.5 KiB
Plaintext
---
|
||
title: "エラーの処理"
|
||
icon: "arrow-rotate-right"
|
||
---
|
||
|
||
<Note> ⚠️ このドキュメントはAIによって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/use-dify/build/predefined-error-handling-logic)を参照してください。</Note>
|
||
|
||
|
||

|
||
[大規模言語モデル](/en/use-dify/nodes/llm)、[HTTP](/en/use-dify/nodes/http-request)、[コード](/en/use-dify/nodes/code)、および[ツール](/en/use-dify/nodes/tools)
|
||
ノードは標準でエラー処理をサポートしています。ノードが失敗した場合、以下の3つの動作のいずれかを取ることができます:
|
||
|
||
<AccordionGroup>
|
||
<Accordion title="なし">
|
||
デフォルトの動作です。ノードが失敗すると、ワークフロー全体が停止します。元のエラーメッセージが表示されます。
|
||
|
||
以下の場合に使用します:
|
||
- テスト中で何が壊れたかを確認したい場合
|
||
- このステップなしではワークフローが続行できない場合
|
||
</Accordion>
|
||
<Accordion title="デフォルト値">
|
||
ノードが失敗した場合、代わりにバックアップ値を使用します。ワークフローは実行を継続します。
|
||
|
||

|
||
|
||
**要件**
|
||
- デフォルト値はノードの出力タイプと一致する必要があります -- 文字列を出力する場合、デフォルトも文字列である必要があります。
|
||
|
||
**例**
|
||
|
||
大規模言語モデルノードは通常分析を返しますが、レート制限により失敗することがあります。以下のようなデフォルト値を設定します:
|
||
|
||
```
|
||
"申し訳ございませんが、一時的にご利用いただけません。数分後に再度お試しください。"
|
||
```
|
||
|
||
これで、ユーザーは壊れたワークフローの代わりに役立つメッセージを受け取ります。
|
||
</Accordion>
|
||
<Accordion title="失敗分岐">
|
||
ノードが失敗した場合、エラーを処理するための別のフローをトリガーします。
|
||
|
||

|
||
|
||
失敗分岐はオレンジ色で強調表示されます。以下のことができます:
|
||
- エラー通知の送信
|
||
- 異なるアプローチの試行
|
||
- デバッグ用のエラーログ記録
|
||
- バックアップサービスの使用
|
||
**例**
|
||
|
||
メインAPIが失敗した場合、失敗分岐が代わりにバックアップAPIを呼び出します。ユーザーは問題があったことを知ることはありません。
|
||
</Accordion>
|
||
</AccordionGroup>
|
||
|
||
## ループ/反復ノードでのエラー
|
||
|
||
ループや反復内で子ノードが失敗した場合、これらの制御フローノードには独自のエラー動作があります。
|
||
|
||
**ループノード**は、子ノードが失敗すると常に即座に停止します。ループ全体が終了してエラーを返し、それ以降の反復の実行を防ぎます。
|
||
|
||
**反復ノード**では、エラー処理モードの設定により、子ノードの失敗をどのように処理するかを選択できます:
|
||
|
||
- `terminated` - 任意のアイテムが失敗すると即座に処理を停止(デフォルト)
|
||
- `continue-on-error` - 失敗したアイテムをスキップして次のアイテムに続行
|
||
- `remove-abnormal-output` - 処理を継続します
|
||
|
||
反復を`continue-on-error`に設定すると、失敗したアイテムは出力配列で`null`を返します。`remove-abnormal-output`を使用すると、出力配列には成功した結果のみが含まれ、入力配列より短くなります。
|
||
|
||
## エラー変数
|
||
|
||
デフォルト値または失敗分岐を使用する場合、2つの特別な変数が得られます:
|
||
|
||
- `error_type` - 発生したエラーの種類([エラータイプ](/ja/use-dify/debug/error-type)を参照)
|
||
- `error_message` - 実際のエラーの詳細
|
||
|
||
これらを以下の目的で使用します:
|
||
- ユーザーに役立つメッセージを表示
|
||
- チームにアラートを送信
|
||
- 異なる回復戦略の選択
|
||
- デバッグ用のエラーログ記録
|
||
|
||
**例**
|
||
|
||
```
|
||
{% if error_type == "rate_limit" %}
|
||
リクエストが多すぎます。しばらくお待ちいただき、再度お試しください。
|
||
{% else %}
|
||
問題が発生しました。当チームに通知されています。
|
||
{% endif %}
|
||
```
|