Skip to content

Commit

Permalink
catch NotImplementedError
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Feb 23, 2024
1 parent fb56ff2 commit ac02039
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/aiida/cmdline/commands/cmd_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ def storage_backup(ctx, manager, dest: str, keep: int):
"""

storage = manager.get_profile_storage()
profile = ctx.obj.profile
try:
storage.backup(dest, keep)
except NotImplementedError:
echo.echo_critical(
f'Profile {profile.name} uses the storage plugin '
f'{profile.storage_backend} which does not implement a backup mechanism.'
)
except (ValueError, exceptions.StorageBackupError) as exception:
echo.echo_critical(str(exception))
echo.echo_success(f'Data storage of profile `{ctx.obj.profile.name}` backed up to `{dest}`')
echo.echo_success(f'Data storage of profile `{profile.name}` backed up to `{dest}`')

1 comment on commit ac02039

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

The requirements/ files are inconsistent!

Please sign in to comment.