From e66adcca38461c7fb4c0c44eb4f4fb4b4d4d0a84 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 17 Apr 2024 20:13:37 +1000 Subject: [PATCH] alertOnError should default to true Regressed in svelte-kit port --- ts/lib/generated/post.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/lib/generated/post.ts b/ts/lib/generated/post.ts index b6ca25ca3..90e372520 100644 --- a/ts/lib/generated/post.ts +++ b/ts/lib/generated/post.ts @@ -10,7 +10,7 @@ export async function postProto( method: string, input: { toBinary(): Uint8Array; getType(): { typeName: string } }, outputType: { fromBinary(arr: Uint8Array): T }, - options: PostProtoOptions | undefined, + options: PostProtoOptions = {}, ): Promise { try { const inputBytes = input.toBinary(); @@ -18,7 +18,8 @@ export async function postProto( const outputBytes = await postProtoInner(path, inputBytes); return outputType.fromBinary(outputBytes); } catch (err) { - if (options?.alertOnError && !(err instanceof Error && err.message === "500: Interrupted")) { + const { alertOnError = true } = options; + if (alertOnError && !(err instanceof Error && err.message === "500: Interrupted")) { alert(err); } throw err;