From fca3311925228fb2b51eedac624119e2b737c9dc Mon Sep 17 00:00:00 2001 From: cccc <132337734+2725244134@users.noreply.github.com> Date: Wed, 29 Oct 2025 21:01:23 +0800 Subject: [PATCH] refactor: specify type annotation for error handling methods in RequestError class --- src/acp/exceptions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acp/exceptions.py b/src/acp/exceptions.py index c9a4dd9..898ca40 100644 --- a/src/acp/exceptions.py +++ b/src/acp/exceptions.py @@ -14,11 +14,11 @@ def __init__(self, code: int, message: str, data: Any | None = None) -> None: self.data = data @staticmethod - def parse_error(data: dict | None = None) -> RequestError: + def parse_error(data: dict[str, Any] | None = None) -> RequestError: return RequestError(-32700, "Parse error", data) @staticmethod - def invalid_request(data: dict | None = None) -> RequestError: + def invalid_request(data: dict[str, Any] | None = None) -> RequestError: return RequestError(-32600, "Invalid request", data) @staticmethod @@ -26,15 +26,15 @@ def method_not_found(method: str) -> RequestError: return RequestError(-32601, "Method not found", {"method": method}) @staticmethod - def invalid_params(data: dict | None = None) -> RequestError: + def invalid_params(data: dict[str, Any] | None = None) -> RequestError: return RequestError(-32602, "Invalid params", data) @staticmethod - def internal_error(data: dict | None = None) -> RequestError: + def internal_error(data: dict[str, Any] | None = None) -> RequestError: return RequestError(-32603, "Internal error", data) @staticmethod - def auth_required(data: dict | None = None) -> RequestError: + def auth_required(data: dict[str, Any] | None = None) -> RequestError: return RequestError(-32000, "Authentication required", data) @staticmethod