We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c74507 commit 27dd945Copy full SHA for 27dd945
test/helpers/rest.ts
@@ -139,10 +139,15 @@ export class RESTClient {
139
}
140
141
const slug = args.slug || this.defaultSlug;
142
- const response = await fetch(`${this.serverURL}/api/${slug}`, options);
143
- const { status } = response;
144
- const { doc } = await response.json();
145
- return { status, doc };
+ try {
+ const response = await fetch(`${this.serverURL}/api/${slug}`, options);
+ const { status } = response;
+ const { doc } = await response.json();
146
+ return { status, doc };
147
+ } catch (err) {
148
+ console.error(err);
149
+ return { status: 500 };
150
+ }
151
152
153
async find<T = any>(args?: FindArgs): Promise<QueryResponse<T>> {
0 commit comments