chore: adds logging to debug why tests not passing in ci

This commit is contained in:
James
2023-01-04 11:36:38 -05:00
parent 7c74507bca
commit 27dd945544

View File

@@ -139,10 +139,15 @@ export class RESTClient {
}
const slug = args.slug || this.defaultSlug;
const response = await fetch(`${this.serverURL}/api/${slug}`, options);
const { status } = response;
const { doc } = await response.json();
return { status, doc };
try {
const response = await fetch(`${this.serverURL}/api/${slug}`, options);
const { status } = response;
const { doc } = await response.json();
return { status, doc };
} catch (err) {
console.error(err);
return { status: 500 };
}
}
async find<T = any>(args?: FindArgs): Promise<QueryResponse<T>> {