diff --git a/plugins/catalog-unprocessed-entities/src/api/index.ts b/plugins/catalog-unprocessed-entities/src/api/index.ts index 030a4d0293..ae5feedf84 100644 --- a/plugins/catalog-unprocessed-entities/src/api/index.ts +++ b/plugins/catalog-unprocessed-entities/src/api/index.ts @@ -73,11 +73,12 @@ export class CatalogUnprocessedEntitiesClient private async fetch(path: string, init?: RequestInit): Promise { const url = await this.discovery.getBaseUrl('catalog'); const resp = await this.fetchApi.fetch(`${url}/${path}`, init); + if (!resp.ok) { throw await ResponseError.fromResponse(resp); } - return await resp.json(); + return resp.status === 204 ? (resp as T) : await resp.json(); } async pending(): Promise {