Merge pull request #5993 from urbit/po/return-rejected-promise-for-scry

http-api: If scry fails, return reject response
This commit is contained in:
Patrick O'Sullivan 2022-09-12 14:23:42 -05:00 committed by GitHub
commit 08f0e4c281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -545,7 +545,12 @@ export class Urbit {
const response = await fetch( const response = await fetch(
`${this.url}/~/scry/${app}${path}.json`, `${this.url}/~/scry/${app}${path}.json`,
this.fetchOptions this.fetchOptions
); )
if (!response.ok) {
return Promise.reject(response);
}
return await response.json(); return await response.json();
} }