Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the .message field on exceptions non-empty #2947

Merged
merged 8 commits into from
Jun 22, 2024
Prev Previous commit
Next Next commit
Update exceptions.py
  • Loading branch information
ekzhang committed May 6, 2024
commit 7901b2c45c566293faafb1a7c7032fb20a86e2fc
4 changes: 2 additions & 2 deletions sanic/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def __init__(
)
quiet = quiet or getattr(self.__class__, "quiet", None)
headers = headers or getattr(self.__class__, "headers", {})
if not isinstance(message, str):
# If a `bytes`-like object is provided, normalize it to a string.
if isinstance(message, bytes):
# If a `bytes` object is provided, normalize it to a string.
message = message.decode("utf8")
if message is None:
cls_message = getattr(self.__class__, "message", None)
Expand Down
Loading