Skip to content

Commit

Permalink
Fix Catch for Compile (#1137)
Browse files Browse the repository at this point in the history
* fix bug

* fix

* update

* update

* resolve review

* update

* fix try catch
  • Loading branch information
FusionBolt authored Nov 29, 2023
1 parent 2b686b4 commit af51399
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Nncase.Studio/ViewModels/CompileViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,17 @@ public async Task Compile()
{
await Task.Run(async () => await compiler.CompileAsync(progress, _cts.Token));
}
catch (Exception)
catch (OperationCanceledException)
{
Context.OpenDialog("Compile has been cancel");
ProgressBarValue = 0;
return;
}
catch (Exception exp)
{
Context.OpenDialog($"Error:{exp.Message}");
return;
}

using (var os = File.OpenWrite(KmodelPath))
{
Expand Down

0 comments on commit af51399

Please sign in to comment.