Skip to content

Commit 47c5a5c

Browse files
committed
Use porper error name
The new error added now matches the naming convention for typed errors
1 parent dde9add commit 47c5a5c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

client/src/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from "@1password/sdk-core";
77

88
import { ReplacerFunc } from "./types";
9-
import { DesktopSessionExpired, throwError } from "./errors";
9+
import { DesktopSessionExpiredError, throwError } from "./errors";
1010

1111
// In empirical tests, we determined that maximum message size that can cross the FFI boundary
1212
// is ~64MB. Past this limit, the wasm-bingen FFI will throw an error and the program will crash.
@@ -170,7 +170,7 @@ export class InnerClient {
170170
try {
171171
return await this.core.invoke(config);
172172
} catch (err: unknown) {
173-
if (err instanceof DesktopSessionExpired) {
173+
if (err instanceof DesktopSessionExpiredError) {
174174
const newId = await this.core.initClient(this.config);
175175
this.id = parseInt(newId, 10);
176176
config.invocation.clientId = this.id;

client/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Code generated by op-codegen - DO NOT EDIT MANUALLY
22

3-
export class DesktopSessionExpired extends Error {
3+
export class DesktopSessionExpiredError extends Error {
44
public message: string;
55

66
public constructor(message: string) {
@@ -33,7 +33,7 @@ export const throwError = (errString: string) => {
3333

3434
switch (err.name) {
3535
case "DesktopSessionExpired":
36-
throw new DesktopSessionExpired(err.message);
36+
throw new DesktopSessionExpiredError(err.message);
3737
case "RateLimitExceeded":
3838
throw new RateLimitExceededError(err.message);
3939
default:

0 commit comments

Comments
 (0)