diff --git a/src/api/OpenProcessing.ts b/src/api/OpenProcessing.ts index c32bc25874..02a533ba38 100644 --- a/src/api/OpenProcessing.ts +++ b/src/api/OpenProcessing.ts @@ -43,6 +43,12 @@ export const getCurationSketches = async ( const response = await fetch( `${openProcessingEndpoint}curation/${curationId}/sketches?${limitParam}`, ); + + if (!response.ok) { + //log error instead of throwing error to not cache result in memoize + console.error("getCurationSketches", response.status, response.statusText); + } + const payload = await response.json(); return payload as OpenProcessingCurationResponse; }; @@ -78,6 +84,12 @@ export const getSketch = memoize(async ( id: string, ): Promise => { const response = await fetch(`${openProcessingEndpoint}sketch/${id}`); + + if (!response.ok) { + //log error instead of throwing error to not cache result in memoize + console.error("getSketch", id, response.status, response.statusText); + } + const payload = await response.json(); return payload as OpenProcessingSketchResponse; }); @@ -89,6 +101,12 @@ export const getSketchSize = memoize(async (id: string) => { } const response = await fetch(`${openProcessingEndpoint}sketch/${id}/code`); + + if (!response.ok) { + //log error instead of throwing error to not cache result in memoize + console.error("getSketchSize", id, response.status, response.statusText); + } + const payload = await response.json(); for (const tab of payload) {