From f1cc532f3d135276ae0f90104ee8a88b5f608a29 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 26 Jun 2023 15:52:08 +0200 Subject: [PATCH] Fix: if the http request failed, the error would be [object Array] --- src/Marvin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Marvin.ts b/src/Marvin.ts index fb265f5..ac387af 100644 --- a/src/Marvin.ts +++ b/src/Marvin.ts @@ -73,7 +73,7 @@ export class Marvin { } return response.text() } else { - throw [response.status, await response.text()] + throw new Error(`got http ${response.status}: ${await response.text()}`) } } async test() {