From b799955d7a300f54ec262c94997c1e0eb3328a87 Mon Sep 17 00:00:00 2001 From: Paul Paterson Date: Tue, 21 May 2024 15:42:35 -0400 Subject: [PATCH] Revert error handling for standard queries (#268) --- package.json | 2 +- src/http-client/node-http2-client.ts | 15 ++------------- src/util/package-version.ts | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index ee241bb4..e1d6e65d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fauna", - "version": "2.0.0", + "version": "2.0.1", "description": "A driver to query Fauna databases in browsers, Node.js, and other Javascript runtimes", "homepage": "https://fauna.com", "bugs": { diff --git a/src/http-client/node-http2-client.ts b/src/http-client/node-http2-client.ts index 9f69bedf..7ee330c2 100644 --- a/src/http-client/node-http2-client.ts +++ b/src/http-client/node-http2-client.ts @@ -94,7 +94,6 @@ export class NodeHTTP2Client implements HTTPClient, HTTPStreamClient { // a GOAWAY can come and cause the request to fail // with a GOAWAY. if (error?.code !== "ERR_HTTP2_GOAWAY_SESSION") { - // TODO: be more discernable about error types throw new NetworkError( "The network connection encountered a problem.", { @@ -205,12 +204,7 @@ export class NodeHTTP2Client implements HTTPClient, HTTPStreamClient { .request(httpRequestHeaders) .setEncoding("utf8") .on("error", (error: any) => { - rejectPromise( - new NetworkError( - "The network connection encountered a problem while streaming events.", - { cause: error }, - ), - ); + rejectPromise(error); }) .on("response", onResponse); @@ -223,12 +217,7 @@ export class NodeHTTP2Client implements HTTPClient, HTTPStreamClient { req.end(); } catch (error) { - rejectPromise( - new NetworkError( - "The network connection encountered a problem while streaming events.", - { cause: error }, - ), - ); + rejectPromise(error); } }); } diff --git a/src/util/package-version.ts b/src/util/package-version.ts index e297bbc6..f040a88a 100644 --- a/src/util/package-version.ts +++ b/src/util/package-version.ts @@ -1,4 +1,4 @@ //THIS FILE IS AUTOGENERATED. DO NOT EDIT. SEE .husky/pre-commit /** The current package version. */ -export const packageVersion = "2.0.0"; +export const packageVersion = "2.0.1";