diff --git a/Meta/Generators/generate_ipc_definitions.py b/Meta/Generators/generate_ipc_definitions.py index 84f389e81e..0d4611775c 100644 --- a/Meta/Generators/generate_ipc_definitions.py +++ b/Meta/Generators/generate_ipc_definitions.py @@ -503,9 +503,17 @@ def write_proxy_method( else: out.write(f"\n return move(*{sync_call});") elif is_try: + if inner_return_type == "void": + success_return = "{}" + elif len(message.outputs) == 1: + output = message.outputs[0] + accessor = output.name if is_primitive_or_simple_type(output.type) else f"take_{output.name}" + success_return = f"result->{accessor}()" + else: + success_return = "move(*result)" out.write(f""" if (auto result = m_connection.template send_sync_but_allow_failure({call_args})) - return {"{}" if inner_return_type == "void" else "move(*result)"}; + return {success_return}; m_connection.shutdown(); return IPC::ErrorCode::PeerDisconnected;""") else: