From 47eb42f0f5f17532323b9d623e6d453f400c7a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 14 Sep 2023 14:44:41 +0000 Subject: [PATCH] missing catch in api_get_blob --- ui/src/plugins/advent22.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ui/src/plugins/advent22.ts b/ui/src/plugins/advent22.ts index 3943c0b..307d559 100644 --- a/ui/src/plugins/advent22.ts +++ b/ui/src/plugins/advent22.ts @@ -127,17 +127,19 @@ export class Advent22 { public api_get_blob(endpoint: string): Promise { return new Promise((resolve, reject) => { - this._api_get(endpoint, "blob").then((data: Blob) => { - const reader = new FileReader(); - reader.readAsDataURL(data); - reader.onloadend = () => { - if (typeof reader.result === "string") { - resolve(reader.result); - } else { - reject(["failed data url", endpoint]); - } - }; - }); + this._api_get(endpoint, "blob") + .then((data: Blob) => { + const reader = new FileReader(); + reader.readAsDataURL(data); + reader.onloadend = () => { + if (typeof reader.result === "string") { + resolve(reader.result); + } else { + reject(["failed data url", endpoint]); + } + }; + }) + .catch(reject); }); }