--- title: "Catch HTTP Connector Errors" slug: "catch-http-connector-errors" updated: 2025-01-08T12:10:27Z published: 2025-01-08T12:10:27Z canonical: "support.tulip.co/catch-http-connector-errors" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # HTTPコネクタのエラーをキャッチする *HTTP API コネクタエラーを検出する使用例と、エラーを記録してコネクタ機能を再試行する方法を理解してください。* ## HTTP コネクタエラーの種類 HTTP プロトコル標準には、**HTTP レスポンスコード**および**HTTP レスポンスメッセージとして**知られる、サーバレスポンスコードおよびメッセージの要件が含まれています。これにより、エンドユーザが発生したエラーの種類を直感的に示すことができるように、標準的な HTTP レスポンスコードクラスまたはカテゴリがあります。これらのコード・クラスには、次のようなものがあります。**1xx*-**informational response**リクエストを受信しました、処理を続行します**2xx*-**successful**リクエストを正常に受信し、理解し、受け付けました**3xx*-**redirection**リクエストを完了するには、**さらに**アクションを実行する必要があります**4xx*-**client error**リクエストに不正な構文が含まれているか、実行できません**5xx*-**server error**明らかに有効なリクエストを実行できませんでした 最も一般的なエラーコードは、`404 - Not Found`または`500 - Internal Server Error`です。これらのエラーコードは、外部システムのサーバーがダウンしている、メンテナンス中である、サービスに問題がある、またはネットワークに問題があることを示しています。 ## 例アプリでHTTPエラーをキャッチする 次の例では、HTTP コネクタ関数のエラーを表示するようにアプリを構成する方法を詳しく説明します。 ### コネクタ関数の構築 Connector Functionビルダでは、コネクタOutput設定でHTTPエラーコードとエラーメッセージをマッピングできます。これにより、HTTPエラーコードとエラーメッセージが、後でTulip Appsで使用するコネクタ関数の出力として渡されます。 1. ![Connector Output Mapping 1.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Connector%20Output%20Mapping%201.png){height="" width=""} HTTPステータスフィールドを出力にマッピングします。 2. 出力に明確な名前を付け、コネクタ関数を再実行して、出力が正しく表示されるかどうかをテストします。![Connector Output Mapping 2.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Connector%20Output%20Mapping%202.png){height="" width=""} 以下の例のようになります。 これは次の例のようになります:![Catch Connector Errors Overview.gif](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Catch%20Connector%20Errors%20Overview.gif){height="" width=""}. ### コネクタのエラーを処理するアプリを構築する アプリでコネクタの出力情報を使用して、コネクタのエラー処理を実行します。 #### アプリのトリガーでコネクタを実行する **Run Connector Function** でトリガアクションを構築します。先ほど構築したコネクタと関数を選択し、結果を**変数として**保存します。![Run Connector Trigger - Error Catching.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Run%20Connector%20Trigger%20-%20Error%20Catching.png){height="" width=""}. HTTP レスポンス コードとメッセージが、新しいアプリ変数の参照として利用できるようになりました。![HTTP Response Code as Variable.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/HTTP%20Response%20Code%20as%20Variable.png){height="" width=""}. #### アプリでのコネクタ応答の可視化 **Connector Response**変数全体を表示する Variable ウィジェットをアプリのステップに配置します。![Visualize connector response with variable widget.gif](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Visualize%20connector%20response%20with%20variable%20widget.gif){height="" width=""}. ### Connector エラー処理トリガの構築 次に、HTTP 応答コードを使用して、後続のトリガ条件でアプリ レベルのエラー処理を実行できます。 1. ![Connector Error Handling Trigger.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Connector%20Error%20Handling%20Trigger.png){height="" width=""}**コネクタ エラー処理を**実行する新しいトリガを作成する。 2. 不正な HTTP 応答コードを検索する条件を作成します。この例では、条件は 200**に等しくない**応答を探します:(Info) (Note) Many systems use a 200 response code as a good response, but it is best to check with the API endpoint provider or IT if all good responses will only be of code 200 ::: 3. ![Bad Response Code Trigger.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Bad%20Response%20Code%20Trigger.png){height="" width=""} 条件が満たされたときに発生するトリガーアクションを作成します。 アプリでは次のようになります:![HTTP Error Response Overview.gif](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/HTTP%20Error%20Response%20Overview.gif){height="" width=""}. ## さらに読む - [HTTP コネクタ関数の作成と設定方法](/r230/docs/how-to-create-and-configure-an-http-connector-function) - [HTTP コネクタ出力のフォーマット方法](/r230/docs/how-to-format-http-connector-outputs) - [アプリでのHTTPコネクターの使用](/r230/docs/using-http-connectors-in-apps) **Output** An **output** is the transmission of data from a program to a data set.