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 ddce9ed commit 9cea079Copy full SHA for 9cea079
api/src/fetch/service.ts
@@ -48,6 +48,10 @@ export class FetchService {
48
private async fetch<T>(url: string, options: FetchOptions) {
49
this.logger.info({ message: `Fetching ${url}` });
50
const response = await this.makeFetchHappenInstance(url, options);
51
+ if (!response.ok) {
52
+ this.logger.error({ message: `Failed to fetch ${url}`, meta: { status: response.status } });
53
+ throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
54
+ }
55
const jsonResponse = (await response.json()) as T;
56
return jsonResponse;
57
}
0 commit comments