What is the appropriate python Exception to raise if there is a missing settings file?
For example, in Django projects, a light-weight way to allow users to define local settings is to add the following snippet to the settings.py file
try:
from local_settings import *
except ImportError:
# want to add informative Exception here
pass
thus, any local settings override the defaults in settings.py.
EnvironmentError
orLookupError
or evenRuntimeError
. But why is it important? You can create your own if you care:class MyCustomErrorThing(Exception): pass