3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

conf: rename ConfigValidationError -> ConfigurationError & inherit from RuntimeError

This commit is contained in:
James Lu 2018-06-13 22:46:58 -07:00
parent 76b58c4432
commit 8386edc6d5

View File

@ -17,7 +17,7 @@ from collections import defaultdict
from . import world
class ConfigValidationError(Exception):
class ConfigurationError(RuntimeError):
"""Error when config conditions aren't met."""
conf = {'bot':
@ -50,9 +50,9 @@ conf['pylink'] = conf['bot']
confname = 'unconfigured'
def validate(condition, errmsg):
"""Raises ConfigValidationError with errmsg unless the given condition is met."""
"""Raises ConfigurationError with errmsg unless the given condition is met."""
if not condition:
raise ConfigValidationError(errmsg)
raise ConfigurationError(errmsg)
def _log(level, text, *args, logger=None, **kwargs):
if logger: