From 47ebda69daa34ea7992b6bbadf46de98dd17a390 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 11 Nov 2024 01:12:29 +0800 Subject: HALF WORK: 2024.1.9 --- tools/cru-py/cru/_error.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/cru-py/cru/_error.py') diff --git a/tools/cru-py/cru/_error.py b/tools/cru-py/cru/_error.py index 0d2bf79..e4bf3d6 100644 --- a/tools/cru-py/cru/_error.py +++ b/tools/cru-py/cru/_error.py @@ -18,9 +18,11 @@ class CruInternalError(CruException): class CruUserFriendlyException(CruException): - def __init__(self, message: str, user_message: str, *args, **kwargs) -> None: + def __init__( + self, message: str, user_message: str | None = None, *args, **kwargs + ) -> None: super().__init__(message, *args, **kwargs) - self._user_message = user_message + self._user_message = user_message or message @property def user_message(self) -> str: -- cgit v1.2.3