Skip to content

Commit

Permalink
fix network boundary error / format (airbytehq#4011)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Jun 9, 2021
1 parent e4335b1 commit 36488ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class ApiErrorBoundary extends React.Component<unknown, BoundaryState> {
return { errorId: ErrorId.VersionMismatch, message: error.message };
}

if (error.message === "Failed to fetch") {
const isNetworkBoundaryMessage = error.message === "Failed to fetch";
const is502 = error.status === 502;

if (isNetworkBoundaryMessage || is502) {
return { errorId: ErrorId.ServerUnavailable };
}

Expand Down
1 change: 1 addition & 0 deletions airbyte-webapp/src/core/request/AirbyteRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ abstract class AirbyteRequestService {
resultJsonResponse = await response.json();
} catch (e) {
// non json result
throw new CommonRequestError(response, "non-json response");
}

if (resultJsonResponse?.error) {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api/generated-api-html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h1>Airbyte Configuration API</h1>
<ul>
<li>All endpoints are http POST methods.</li>
<li>All endpoints accept data via <code>application/json</code> request bodies. The API does not accept any data via query params.</li>
<li>The naming convention for endpoints is: localhost:8001/{VERSION}/{METHOD_FAMILY}/{METHOD_NAME} e.g. <code>localhost:8001/v1/connections/create</code>.</li>
<li>The naming convention for endpoints is: localhost:8000/{VERSION}/{METHOD_FAMILY}/{METHOD_NAME} e.g. <code>localhost:8000/v1/connections/create</code>.</li>
<li>For all <code>update</code> method, the whole object must be passed in, even the fields that did not change.</li>
</ul>
<p>Change Management:</p>
Expand Down

0 comments on commit 36488ef

Please sign in to comment.