Skip to content

Commit 1f6bcf6

Browse files
authored
fix: handle errors on H1 fetch reports (#858)
1 parent 265bf62 commit 1f6bcf6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/request.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ export default class Request {
158158
Accept: 'application/json'
159159
}
160160
};
161-
return this.json(url, options);
161+
const data = await this.json(url, options);
162+
if (data?.errors) {
163+
throw new Error(
164+
`Request to fetch triaged reports failed with: ${JSON.stringify(data.errors)}`
165+
);
166+
}
167+
return data;
162168
}
163169

164170
async getPrograms() {

0 commit comments

Comments
 (0)