Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/src/fetch/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export class FetchService {
private async fetch<T>(url: string, options: FetchOptions) {
this.logger.info({ message: `Fetching ${url}` });
const response = await this.makeFetchHappenInstance(url, options);
if (!response.ok) {
this.logger.error({ message: `Failed to fetch ${url}`, meta: { status: response.status } });
throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
}
const jsonResponse = (await response.json()) as T;
Comment thread
ZibanPirate marked this conversation as resolved.
return jsonResponse;
}
Expand Down
Loading