Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DYN-7942] Catch exception during undo operation. #15812

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/DynamoCore/Core/UndoRedoRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Dynamo.Graph.Connectors;
using Dynamo.Graph.Nodes;
using Dynamo.Graph.Workspaces;
using Dynamo.Logging;

namespace Dynamo.Core
{
Expand Down Expand Up @@ -56,7 +57,7 @@ internal interface IUndoRedoRecorderClient
ModelBase GetModelForElement(XmlElement modelData);
}

internal class UndoRedoRecorder
internal class UndoRedoRecorder : LogSourceBase
{
#region Private Class Data Members

Expand Down Expand Up @@ -241,7 +242,16 @@ public XmlElement PopFromUndoGroup()
"UndoStack cannot be popped with non-empty RedoStack");
}

return PopActionGroupFromUndoStack();
try
{
return PopActionGroupFromUndoStack();
}
catch (InvalidOperationException ex)
{
Log(ex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this logging to Dynamo Console?

Copy link
Contributor Author

@reddyashish reddyashish Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the log(exception) is logged as error to the log file.

return null;
}

}
#endregion

Expand Down
Loading