From f5a8d8e9371451eacc1e5f931cc74d6f2ea08929 Mon Sep 17 00:00:00 2001 From: Patrick O'Sullivan Date: Mon, 12 Sep 2022 09:45:01 -0500 Subject: [PATCH] http-api: If scry fails, return reject response --- pkg/npm/http-api/src/Urbit.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/npm/http-api/src/Urbit.ts b/pkg/npm/http-api/src/Urbit.ts index 9779a397f6..278bc18023 100644 --- a/pkg/npm/http-api/src/Urbit.ts +++ b/pkg/npm/http-api/src/Urbit.ts @@ -545,7 +545,12 @@ export class Urbit { const response = await fetch( `${this.url}/~/scry/${app}${path}.json`, this.fetchOptions - ); + ) + + if (!response.ok) { + return Promise.reject(response); + } + return await response.json(); }