Skip to content

Commit

Permalink
fix: using podman error propagation for error management
Browse files Browse the repository at this point in the history
  • Loading branch information
axel7083 committed Jan 29, 2024
1 parent c5b2610 commit 826969b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/backend/src/studio-api-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,10 @@ export class StudioApiImpl implements StudioAPI {
// Do not wait for the pull application, run it separately
void podmanDesktopApi.window.withProgress<void>(
{ location: podmanDesktopApi.ProgressLocation.TASK_WIDGET, title: `Pulling ${recipe.name}.` },
async progress => {
try {
await this.applicationManager.pullApplication(recipe, model);
// mark the task as completed
progress.report({ increment: -1 });
} catch (error) {
console.warn(error);
progress.report({ message: `Error: ${String(error)}` });
}
},
);
() => this.applicationManager.pullApplication(recipe, model),
).catch(() => {
this.recipeStatusRegistry.setStatus(recipeId, {recipeId: recipeId, state: 'error', tasks: []});
});
}

async getLocalModels(): Promise<ModelInfo[]> {
Expand Down

0 comments on commit 826969b

Please sign in to comment.