Skip to content

Commit

Permalink
Confluence error handling: catch fetch aborts (#4979)
Browse files Browse the repository at this point in the history
Description
---
Those errors occur on the confluence connector when fetch is
aborted. Apparently a timeout can cause either an "AbortError" or a
"TimeoutError"

nodejs/node#43874
  • Loading branch information
philipperolet authored May 6, 2024
1 parent 8940f0a commit 89d7711
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export class ConfluenceClient {
signal: AbortSignal.timeout(30000),
});
} catch (e) {
if (e instanceof DOMException && e.name === "TimeoutError") {
if (
e instanceof DOMException &&
(e.name === "TimeoutError" || e.name === "AbortError")
) {
throw new ConfluenceClientError("Request timed out", {
type: "http_response_error",
status: 504,
Expand Down

0 comments on commit 89d7711

Please sign in to comment.