Skip to content

Commit 0fa3ac4

Browse files
committed
chore: address review comment
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 9cfc080 commit 0fa3ac4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tck/errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ def wrapper(*args, **kwargs):
113113
raise JsonRpcError.hiero_error({"status": ResponseCode(e.status).name}) from e
114114

115115
except MaxAttemptsError as e:
116-
logger.error(f"MaxAttemptsError (method: {func.__name__}, error: {e.message})")
117-
raise JsonRpcError.hiero_error(message=e.message) from e
116+
logger.error(f"MaxAttemptsError (method: {func.__name__}, error: {str(e)})")
117+
raise JsonRpcError.hiero_error() from e
118118

119119
except Exception as e:
120120
logger.error(f"InternalError (method: {func.__name__}) error: {str(e)}")
121-
raise JsonRpcError.internal_error(message="Internal error") from e
121+
raise JsonRpcError.internal_error() from e
122122

123123
return wrapper

tck/handlers/registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def dispatch(method_name: str, params: Any) -> Any:
5050
logger.warning(
5151
f"MethodNotFoundError (method: {repr(method_name)}) error: The requested RPC method is not registered."
5252
)
53-
raise JsonRpcError.method_not_found_error(message=f"Method not found: {method_name}")
53+
raise JsonRpcError.method_not_found_error()
5454

5555
try:
5656
target_func = getattr(handler, "__wrapped__", handler)
@@ -76,7 +76,7 @@ def dispatch(method_name: str, params: Any) -> Any:
7676
raise
7777
except Exception as e:
7878
logger.error(f"InternalError (method: {repr(method_name)}) error: {str(e)}")
79-
raise JsonRpcError.internal_error(message="An unexpected system error occurred.") from e
79+
raise JsonRpcError.internal_error() from e
8080

8181

8282
def safe_dispatch(method_name: str, params: Any, request_id: str | int | None) -> Any | dict[str, Any]:
@@ -87,7 +87,7 @@ def safe_dispatch(method_name: str, params: Any, request_id: str | int | None) -
8787
return build_json_rpc_error_response(e, request_id)
8888
except Exception as e:
8989
logger.error(f"InternalError (method: {repr(method_name)}) error: {str(e)}")
90-
error = JsonRpcError.internal_error(message="An unexpected system error occurred.")
90+
error = JsonRpcError.internal_error()
9191
return build_json_rpc_error_response(error, request_id)
9292

9393

0 commit comments

Comments
 (0)