Skip to content

Commit 0fc8152

Browse files
committed
Fix race condition within HandleWorkflowError
Also adds a more sensible caption to the error dialog when non-workflow errors occur.
1 parent 88a2412 commit 0fc8152

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Bonsai.Editor/EditorForm.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,7 @@ bool HandleSchedulerError(Exception e)
14071407

14081408
void HandleWorkflowError(Exception e)
14091409
{
1410+
var building = this.building; // Ensure the current value of `building` is used when if the handler below is invoked
14101411
Action selectExceptionNode = () =>
14111412
{
14121413
var workflowException = e as WorkflowException;
@@ -1415,7 +1416,7 @@ void HandleWorkflowError(Exception e)
14151416
workflowError = workflowException;
14161417
HighlightExceptionBuilderNode(workflowException, building);
14171418
}
1418-
else editorSite.ShowError(e.Message, Name);
1419+
else editorSite.ShowError(e.Message, "Internal workflow error");
14191420
};
14201421

14211422
if (InvokeRequired) BeginInvoke(selectExceptionNode);

0 commit comments

Comments
 (0)