Skip to content

Commit 43b62aa

Browse files
committed
add minimal error handling to other functions
1 parent 9d48a44 commit 43b62aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/OpenProcessing.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const getCurationSketches = async (
4343
const response = await fetch(
4444
`${openProcessingEndpoint}curation/${curationId}/sketches?${limitParam}`,
4545
);
46-
if(!response.ok){
46+
if(!response.ok){ //log error instead of throwing error to not cache result in memoize
4747
console.log('getCurationSketches', response.status, response.statusText)
4848
}
4949
const payload = await response.json();
@@ -81,7 +81,7 @@ export const getSketch = memoize(async (
8181
id: string,
8282
): Promise<OpenProcessingSketchResponse> => {
8383
const response = await fetch(`${openProcessingEndpoint}sketch/${id}`);
84-
if(!response.ok){
84+
if(!response.ok){ //log error instead of throwing error to not cache result in memoize
8585
console.log('getSketch', id, response.status, response.statusText)
8686
}
8787
const payload = await response.json();
@@ -95,6 +95,9 @@ export const getSketchSize = memoize(async (id: string) => {
9595
}
9696

9797
const response = await fetch(`${openProcessingEndpoint}sketch/${id}/code`);
98+
if(!response.ok){ //log error instead of throwing error to not cache result in memoize
99+
console.log('getSketchSize', id, response.status, response.statusText)
100+
}
98101
const payload = await response.json();
99102

100103
for (const tab of payload) {

0 commit comments

Comments
 (0)