alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 14 forks source link

Non-existent context settings file should be gracefully handled #1897

Closed jemrobinson closed 2 weeks ago

jemrobinson commented 1 month ago
dsh context available
2024-01-23 14:23:46 [    INFO] Reading project settings from '/Users/jrobinson/Library/Application Support/data_safe_haven/contexts.yaml'.                                                                                                             context_settings.py:208
2024-01-23 14:23:46 [   ERROR] Could not find file /Users/jrobinson/Library/Application Support/data_safe_haven/contexts.yaml.                                                                                                                                       cli.py:98
2024-01-23 14:23:46 [   ERROR] [Errno 2] No such file or directory: '/Users/jrobinson/Library/Application Support/data_safe_haven/contexts.yaml'

This exception should be caught and a more helpful error message shown, that tells the user what to do.

JimMadge commented 1 month ago

Should catch that exception in commands/context.py