Skip to content

Commit

Permalink
Better error message when ini file parsing fails
Browse files Browse the repository at this point in the history
It will now include the ini file's path.
  • Loading branch information
Philipp91 committed Aug 14, 2022
1 parent 2b81e0f commit b74cbfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion migrator.py
Expand Up @@ -134,7 +134,10 @@ def migrate_directory(input_dir: Path, files: List[str], db: DigikamDb,
# Read ini file.
ini = configparser.ConfigParser(strict=False)
ini_file = input_dir / ini_file_name
ini.read(ini_file, encoding='utf8')
try:
ini.read(ini_file, encoding='utf8')
except Exception as err:
raise RuntimeError(f'Failed to read ini file "{ini_file}".') from err
used_ini_sections = {'Picasa', 'Contacts', 'Contacts2'}

# Create or look up digiKam tags for each Picasa album and contact/person.
Expand Down

0 comments on commit b74cbfc

Please sign in to comment.