Skip to content

Commit

Permalink
Merge pull request #1047 from mantidproject/catch_unhandled_exception
Browse files Browse the repository at this point in the history
Catch unhandled exceptions
  • Loading branch information
SilkeSchomann authored Jan 27, 2025
2 parents 6d8d676 + 2aed852 commit 29af7b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/mslice/models/workspacemanager/workspace_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ def add_workspace(workspace, name):


def remove_workspace(workspace):
workspace = get_workspace_handle(workspace)
try:
workspace = get_workspace_handle(workspace)
except KeyError:
return
del _loaded_workspaces[workspace.name]


def rename_workspace(workspace, new_name):
workspace = get_workspace_handle(workspace)
try:
workspace = get_workspace_handle(workspace)
except KeyError:
return
_loaded_workspaces[new_name] = _loaded_workspaces.pop(workspace.name)
workspace.name = new_name
return workspace
Expand All @@ -49,7 +55,7 @@ def delete_workspace(workspace):
try:
workspace = get_workspace_handle(workspace)
except KeyError:
return None
return
remove_workspace(workspace)
del workspace

Expand Down

0 comments on commit 29af7b2

Please sign in to comment.