Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Better error handling if setting file cannot be loaded (Fixes #29).
Browse files Browse the repository at this point in the history
  • Loading branch information
kingosticks committed Mar 28, 2019
1 parent a9f79ea commit d0fef60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mopidy_websettings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def get(self):
templateLoader = jinja2.FileSystemLoader(searchpath="/")
templateEnv = jinja2.Environment(loader=templateLoader)
template = templateEnv.get_template(template_file)
error = ''

# Read config file
try:
Expand All @@ -86,9 +85,10 @@ def get(self):
except (ConfigObjError, IOError) as e:
error = 'Could not load ini file! %s' % e
logger.error(error)
self.write(error)
return

templateVars = {
'error': error,
'change_root_password': can_change_root_password(iniconfig)
}
# Read values of valid items (in the spec-file)
Expand Down

0 comments on commit d0fef60

Please sign in to comment.