Skip to content

Commit 69257ec

Browse files
committed
Forward exception if not an abort error.
1 parent 4beb427 commit 69257ec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/web/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class WorkerWrappedAsyncDatabaseConnection<Config extends ResolvedWebSQLO
5555
* This lock will be held as long as this connection is open.
5656
* The `shareConnection` method should not be called on multiple tabs concurrently.
5757
*/
58-
await new Promise<void>((lockObtained) =>
58+
await new Promise<void>((lockObtained, reject) =>
5959
navigator.locks
6060
.request(
6161
`shared-connection-${this.options.identifier}`,
@@ -78,8 +78,12 @@ export class WorkerWrappedAsyncDatabaseConnection<Config extends ResolvedWebSQLO
7878
});
7979
}
8080
)
81-
// We aren't concerned with errors here
82-
.catch(() => {})
81+
// We aren't concerned with abort errors here
82+
.catch((ex) => {
83+
if (ex.name != 'AbortError') {
84+
reject(ex);
85+
}
86+
})
8387
);
8488

8589
const newPort = await remote[Comlink.createEndpoint]();

0 commit comments

Comments
 (0)