mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
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:
commit
08f0e4c281
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user