Skip to content

fix: raise errors instead of returning fake data when C++ extension is unavailable#18

Merged
vtz merged 1 commit intomainfrom
fix/raise-on-missing-cpp-extension
Apr 22, 2026
Merged

fix: raise errors instead of returning fake data when C++ extension is unavailable#18
vtz merged 1 commit intomainfrom
fix/raise-on-missing-cpp-extension

Conversation

@vtz
Copy link
Copy Markdown
Owner

@vtz vtz commented Apr 22, 2026

Summary

  • RPC, Transport, Events: Operations that require the native C++ extension (RpcClient.call(), Transport.send(), EventSubscriber.subscribe(), EventPublisher.notify(), EventPublisher.set_field()) now raise clear errors (RpcError, TransportError, RuntimeError) instead of silently returning empty/fake responses or dropping messages.
  • Error propagation: RpcClient.call() now wraps native C++ exceptions in RpcError and raises on non-zero result codes, instead of swallowing errors with except Exception: pass.
  • README: Added "Verify native extension" subsection after Installation and updated the troubleshooting section to describe the new error-raising behavior.

Test plan

  • pytest tests/unit/ — 271 tests pass
  • pytest tests/ — all 300 tests pass (unit + integration + property)
  • Tests updated to assert RpcError / TransportError / RuntimeError when C++ extension is unavailable
  • New tests: test_call_raises_without_native, test_call_propagates_cpp_exception, test_call_async_raises_without_native, test_send_raises_without_native, test_subscribe_raises_without_native, test_notify_raises_without_native, test_set_field_raises_without_native
  • Verify on macOS without C++ extension: import opensomeip succeeds, client.call(...) raises RpcError with helpful message

Fixes #17

Made with Cursor

…s unavailable

Operations that require the native C++ extension (RPC calls, transport
send, event subscriptions) now raise clear errors instead of silently
returning empty/fake responses. Updates README with installation
verification steps.

Fixes #17
@vtz vtz merged commit 51c1545 into main Apr 22, 2026
17 of 18 checks passed
@vtz vtz deleted the fix/raise-on-missing-cpp-extension branch April 22, 2026 16:55
@vtz vtz mentioned this pull request Apr 22, 2026
2 tasks
vtz added a commit that referenced this pull request Apr 22, 2026
Remove unused `MessageType` import from test_client.py and unused
`asyncio` import from test_rpc.py. Combine nested `with` statements
per SIM117. Apply ruff format to rpc.py and transport.py.

Made-with: Cursor
vtz added a commit that referenced this pull request Apr 22, 2026
Remove unused `MessageType` import from test_client.py and unused
`asyncio` import from test_rpc.py. Combine nested `with` statements
per SIM117. Apply ruff format to rpc.py and transport.py.
vtz added a commit that referenced this pull request Apr 22, 2026
Remove unused `MessageType` import from test_client.py and unused
`asyncio` import from test_rpc.py. Combine nested `with` statements
per SIM117. Apply ruff format to rpc.py and transport.py.
@vtz vtz mentioned this pull request Apr 22, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: RpcClient.call() and Transport.send() silently return fake data when C++ extension is missing

1 participant