diff --git a/lib/request.js b/lib/request.js index a4b43586..2c0e1a5e 100644 --- a/lib/request.js +++ b/lib/request.js @@ -158,7 +158,13 @@ export default class Request { Accept: 'application/json' } }; - return this.json(url, options); + const data = await this.json(url, options); + if (data?.errors) { + throw new Error( + `Request to fetch triaged reports failed with: ${JSON.stringify(data.errors)}` + ); + } + return data; } async getPrograms() {