From bbffdcbd688584936d2c84aa1ae5c4ab1240aebc Mon Sep 17 00:00:00 2001 From: Stephen Sadowski Date: Mon, 24 Jan 2022 06:52:36 -0600 Subject: [PATCH] fix: added message when ValueError is raised for strtobool replacement --- sanic/server/loop.py | 2 +- setup.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sanic/server/loop.py b/sanic/server/loop.py index dd64d2b7..cae2dc72 100644 --- a/sanic/server/loop.py +++ b/sanic/server/loop.py @@ -18,7 +18,7 @@ def strtobool(query: str) -> bool: elif query.lower() in ["n", "no", "f", "false", "off", "0"]: return False else: - raise ValueError + raise ValueError(f'String value {query} cannot be converted to bool') def try_use_uvloop() -> None: diff --git a/setup.py b/setup.py index 4f289673..5877c7dc 100644 --- a/setup.py +++ b/setup.py @@ -22,8 +22,7 @@ def strtobool(query: str) -> bool: elif query.lower() in ["n", "no", "f", "false", "off", "0"]: return False else: - raise ValueError - + raise ValueError(f'String value {query} cannot be converted to bool') class PyTest(TestCommand): """