Skip to content

Commit

Permalink
Broaden exception catching for corrupt i18n files
Browse files Browse the repository at this point in the history
Fixes Sentry issue CURA-24C.
  • Loading branch information
Ghostkeeper committed May 19, 2021
1 parent 10c766c commit a8af98f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UM/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _update(self) -> None:
if gettext.find(cast(str, self.__name), path, languages = [self.__language]):
try:
self.__translation = gettext.translation(cast(str, self.__name), path, languages = [self.__language])
except (OSError, struct.error):
except (EnvironmentError, struct.error, UnicodeDecodeError):
Logger.warning("Corrupt or inaccessible translation file: {fname}".format(fname = self.__name))

self.__require_update = False
Expand Down

0 comments on commit a8af98f

Please sign in to comment.