diff --git a/lib/galaxy/exceptions/__init__.py b/lib/galaxy/exceptions/__init__.py index 88513f318a8e..d167a2e1fd00 100644 --- a/lib/galaxy/exceptions/__init__.py +++ b/lib/galaxy/exceptions/__init__.py @@ -30,7 +30,7 @@ class MessageException(Exception): # Error code information embedded into API json responses. err_code: ErrorCode = error_codes_by_name["UNKNOWN"] - def __init__(self, err_msg: str = "", type="info", **extra_error_info): + def __init__(self, err_msg: Optional[str] = None, type="info", **extra_error_info): self.err_msg = err_msg or self.err_code.default_error_message self.type = type self.extra_error_info = extra_error_info @@ -64,7 +64,7 @@ class AcceptedRetryLater(MessageException): err_code = error_codes_by_name["ACCEPTED_RETRY_LATER"] retry_after: int - def __init__(self, msg: str, retry_after=60): + def __init__(self, msg: Optional[str] = None, retry_after=60): super().__init__(msg) self.retry_after = retry_after @@ -136,7 +136,7 @@ class ToolMissingException(MessageException): status_code = 400 err_code = error_codes_by_name["USER_TOOL_MISSING_PROBLEM"] - def __init__(self, err_msg: str = "", type="info", tool_id=None, **extra_error_info): + def __init__(self, err_msg: Optional[str] = None, type="info", tool_id=None, **extra_error_info): super().__init__(err_msg, type, **extra_error_info) self.tool_id = tool_id @@ -152,7 +152,7 @@ class ToolInputsNotReadyException(MessageException): class ToolInputsNotOKException(MessageException): - def __init__(self, err_msg: str = "", type="info", *, src: str, id: int, **extra_error_info): + def __init__(self, err_msg: Optional[str] = None, type="info", *, src: str, id: int, **extra_error_info): super().__init__(err_msg, type, **extra_error_info) self.src = src self.id = id