From e3557760df34fe05fea663f10ef5ce85fcc41a2b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 25 Jul 2023 12:22:41 +0300 Subject: [PATCH] Raise generic Python exception --- platformio/home/rpc/handlers/account.py | 9 +-------- platformio/home/rpc/handlers/registry.py | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/platformio/home/rpc/handlers/account.py b/platformio/home/rpc/handlers/account.py index b3ba3521..fcbc85ba 100644 --- a/platformio/home/rpc/handlers/account.py +++ b/platformio/home/rpc/handlers/account.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ajsonrpc.core import JSONRPC20DispatchException - from platformio.account.client import AccountClient from platformio.home.rpc.handlers.base import BaseRPCHandler @@ -23,9 +21,4 @@ class AccountRPC(BaseRPCHandler): @staticmethod def call_client(method, *args, **kwargs): - try: - return getattr(AccountClient(), method)(*args, **kwargs) - except Exception as exc: # pylint: disable=bare-except - raise JSONRPC20DispatchException( - code=5000, message="PIO Account Call Error", data=str(exc) - ) from exc + return getattr(AccountClient(), method)(*args, **kwargs) diff --git a/platformio/home/rpc/handlers/registry.py b/platformio/home/rpc/handlers/registry.py index a862df06..ee10d679 100644 --- a/platformio/home/rpc/handlers/registry.py +++ b/platformio/home/rpc/handlers/registry.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ajsonrpc.core import JSONRPC20DispatchException - from platformio.home.rpc.handlers.base import BaseRPCHandler from platformio.registry.client import RegistryClient @@ -23,9 +21,4 @@ class RegistryRPC(BaseRPCHandler): @staticmethod def call_client(method, *args, **kwargs): - try: - return getattr(RegistryClient(), method)(*args, **kwargs) - except Exception as exc: # pylint: disable=bare-except - raise JSONRPC20DispatchException( - code=5000, message="Registry Call Error", data=str(exc) - ) from exc + return getattr(RegistryClient(), method)(*args, **kwargs)