http-api: If scry fails, return reject response

This commit is contained in:
Patrick O'Sullivan 2022-09-12 09:45:01 -05:00
parent a4986078f5
commit f5a8d8e937

View File

@ -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();
}