Skip to content

Commit b197f18

Browse files
author
colinmcneil
committed
Better catalog errors
1 parent 33f862d commit b197f18

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/extension/ui/src/context/CatalogContext.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ export function CatalogProvider({ children, client }: CatalogProviderProps) {
129129
}
130130
return itemsWithName.reverse() as CatalogItemWithName[];
131131
} catch (error) {
132-
if (showNotification) {
133-
client.desktopUI.toast.error('Failed to get latest catalog.' + error);
134-
}
132+
client.desktopUI.toast.error('Failed to get latest catalog.' + error);
135133
throw error;
136134
}
137135
},
@@ -222,7 +220,8 @@ export function CatalogProvider({ children, client }: CatalogProviderProps) {
222220
await client.docker.cli.exec('pull', ['alpine:latest']);
223221
return result;
224222
} catch (error) {
225-
console.error(error);
223+
client.desktopUI.toast.error('Failed to pull images: ' + error);
224+
throw error;
226225
}
227226
},
228227
staleTime: Infinity, // Only load images when explicitly requested
@@ -288,9 +287,7 @@ export function CatalogProvider({ children, client }: CatalogProviderProps) {
288287
await tryRunImageSync(client, ['--rm', '-v', 'docker-prompts:/docker-prompts', '--workdir', '/docker-prompts', 'vonwig/function_write_files:latest', payload]);
289288
return { item, showNotification };
290289
} catch (error) {
291-
if (showNotification) {
292-
client.desktopUI.toast.error('Failed to register prompt: ' + error);
293-
}
290+
client.desktopUI.toast.error('Failed to register prompt: ' + error);
294291
throw error;
295292
}
296293
},

0 commit comments

Comments
 (0)