From 380652eb528323d3ece885e94ed3b46e10a33415 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Jan 2023 20:51:37 +0200 Subject: [PATCH] Raise 5000 error for RPC calls --- platformio/home/rpc/handlers/account.py | 2 +- platformio/home/rpc/handlers/piocore.py | 2 +- platformio/home/rpc/handlers/registry.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio/home/rpc/handlers/account.py b/platformio/home/rpc/handlers/account.py index d857d587..2987329e 100644 --- a/platformio/home/rpc/handlers/account.py +++ b/platformio/home/rpc/handlers/account.py @@ -25,5 +25,5 @@ class AccountRPC: return getattr(client, method)(*args, **kwargs) except Exception as exc: # pylint: disable=bare-except raise JSONRPC20DispatchException( - code=4003, message="PIO Account Call Error", data=str(exc) + code=5000, message="PIO Account Call Error", data=str(exc) ) from exc diff --git a/platformio/home/rpc/handlers/piocore.py b/platformio/home/rpc/handlers/piocore.py index df252114..95b7b478 100644 --- a/platformio/home/rpc/handlers/piocore.py +++ b/platformio/home/rpc/handlers/piocore.py @@ -94,7 +94,7 @@ class PIOCoreRPC: return PIOCoreRPC._process_result(result, to_json) except Exception as exc: # pylint: disable=bare-except raise JSONRPC20DispatchException( - code=4003, message="PIO Core Call Error", data=str(exc) + code=5000, message="PIO Core Call Error", data=str(exc) ) from exc @staticmethod diff --git a/platformio/home/rpc/handlers/registry.py b/platformio/home/rpc/handlers/registry.py index a6d5b8bf..fa6f702c 100644 --- a/platformio/home/rpc/handlers/registry.py +++ b/platformio/home/rpc/handlers/registry.py @@ -25,5 +25,5 @@ class RegistryRPC: return getattr(client, method)(*args, **kwargs) except Exception as exc: # pylint: disable=bare-except raise JSONRPC20DispatchException( - code=4003, message="Registry Call Error", data=str(exc) + code=5000, message="Registry Call Error", data=str(exc) ) from exc