We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BrokenPipe
1 parent e452d8a commit 014f600Copy full SHA for 014f600
1 file changed
client.ts
@@ -274,7 +274,18 @@ export abstract class QueryClient {
274
_query: Query<ResultType.OBJECT>,
275
): Promise<QueryObjectResult<T>>;
276
async #executeQuery(query: Query<ResultType>): Promise<QueryResult> {
277
- return await this.#connection.query(query);
+ try {
278
+ return await this.#connection.query(query);
279
+ } catch (e) {
280
+ if (e instanceof Deno.errors.BrokenPipe) {
281
+ // Retry once with fresh connection, if connection was dropped by server since last query
282
+ await this.closeConnection();
283
+ await this.connect();
284
285
+ } else {
286
+ throw e;
287
+ }
288
289
}
290
291
/**
0 commit comments