From 31983ae81cc4bfe2e92173b447adb28e75d3d046 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Thu, 17 Apr 2025 15:41:18 +0200 Subject: [PATCH] More verbose error handling for RPCs. --- repos/base/include/base/rpc_client.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/repos/base/include/base/rpc_client.h b/repos/base/include/base/rpc_client.h index ae4129aa47..69a99e4266 100644 --- a/repos/base/include/base/rpc_client.h +++ b/repos/base/include/base/rpc_client.h @@ -149,11 +149,15 @@ namespace Genode { } /* perform RPC, unmarshal return value */ - Rpc_exception_code const exception_code = - ipc_call(*this, call_buf, reply_buf, RECEIVE_CAPS); + try { + Rpc_exception_code const exception_code = + ipc_call(*this, call_buf, reply_buf, RECEIVE_CAPS); - if (exception_code.value == Rpc_exception_code::INVALID_OBJECT) + if (exception_code.value == Rpc_exception_code::INVALID_OBJECT) { + error("Invalid server object"); throw Ipc_error(); + } + Ipc_unmarshaller unmarshaller(reply_buf); @@ -171,6 +175,10 @@ namespace Genode { /* the return value does only exist if no exception was thrown */ Meta::Overload_selector ret_overloader; return unmarshaller.extract(ret_overloader); + } catch (Genode::Ipc_error) { + error("IPC error: IF=", IF::name()); + throw Genode::Ipc_error(); + } } }