From f7c8b52e40464b932c9aa6d7b74174d9cbeca401 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 19 Oct 2015 23:04:43 +0200 Subject: [PATCH] Properly log the error when the language code is unknown --- patacrep/songs/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py index 7830f5c4..dcea0e27 100644 --- a/patacrep/songs/__init__.py +++ b/patacrep/songs/__init__.py @@ -27,8 +27,8 @@ def lang2language(lang): try: return BABEL_LANGUAGES[lang] except KeyError: - # TODO: raise a nice error - print('Unknown lang:' + lang) + available = ", ".join(BABEL_LANGUAGES.keys()) + LOGGER.error('Unknown lang code: ' + lang + '. Supported: ' + available) return 'english' def cached_name(datadir, filename):