Bladeren bron

include expected type of config option in error

Unrud 8 jaren geleden
bovenliggende
commit
1812aeb238
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      radicale/config.py

+ 3 - 2
radicale/config.py

@@ -232,6 +232,7 @@ def load(paths=(), extra_config=None, ignore_missing_paths=True):
                     type_(config.get(section, option))
                     type_(config.get(section, option))
             except Exception as e:
             except Exception as e:
                 raise RuntimeError(
                 raise RuntimeError(
-                    "Invalid value %r for option %r in section %r in config" %
-                    (config.get(section, option), option, section)) from e
+                    "Invalid %s value for option %r in section %r in config: "
+                    "%r" % (type_.__name__, option, section,
+                            config.get(section, option))) from e
     return config
     return config