mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 13:20:30 +08:00
feat: improve error handling and cancellation behavior in AI assistant
- Display error (include exception) in current window - Improve cancellation behavior to preserve current `IsGenerating` state for proper UI updates Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -57,11 +57,16 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Do nothing
|
||||
// Do nothing and leave `IsGenerating` to current (may already changed), so that the UI can update accordingly.
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.RaiseException(_repo, e.Message);
|
||||
builder
|
||||
.AppendLine()
|
||||
.AppendLine("[ERROR]")
|
||||
.Append(e.Message);
|
||||
Text = builder.ToString();
|
||||
}
|
||||
|
||||
IsGenerating = false;
|
||||
|
||||
Reference in New Issue
Block a user