From 3466a3c43e50cf6fc55636352b82eab3f407c7f3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 4 Oct 2019 10:25:48 +0100 Subject: Allow utils.Setting_ parse functions to throw detailed errors --- src/utils/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 36157204..e9e7bee5 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -264,6 +264,9 @@ def is_ip(s: str) -> bool: def is_main_thread() -> bool: return threading.current_thread() is threading.main_thread() +class SettingParseException(Exception): + pass + class Setting(object): example: typing.Optional[str] = None def __init__(self, name: str, help: str=None, example: str=None): -- cgit v1.3.1-10-gc9f91