From 16f0cf4a03b5a3cc7a7a1b55f8a9254d9f09fe79 Mon Sep 17 00:00:00 2001 From: ZzZombo Date: Wed, 14 Aug 2024 14:03:15 +0800 Subject: [PATCH] Propagate the `AbortError` up to the caller If the dialog is closed by the player the callers will not continue as if the process succeeded. The callers have their own exception handling that although is basic does not let the program to end up in disarray, but probably needs at least a better error message shown. --- assets/Script/General/NativeSdk.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/Script/General/NativeSdk.ts b/assets/Script/General/NativeSdk.ts index 5949b33..096cb59 100644 --- a/assets/Script/General/NativeSdk.ts +++ b/assets/Script/General/NativeSdk.ts @@ -183,6 +183,8 @@ export class DefaultNativeSdk { await stream.write(content); await stream.close(); } catch (error) { + if(error instanceof AbortError) + throw error; downloadFile(content, suggestedName); } }