Skip to content

Add message and error handlers#137

Merged
isteinbrecher merged 1 commit into
imcs-compsim:mainfrom
isteinbrecher:message-handler
Jun 18, 2026
Merged

Add message and error handlers#137
isteinbrecher merged 1 commit into
imcs-compsim:mainfrom
isteinbrecher:message-handler

Conversation

@isteinbrecher

Copy link
Copy Markdown
Collaborator

Add a message handler that correctly passes on messages (usually warnings) and errors from Coreform to CubitPy.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a mechanism for propagating Coreform/Cubit messages (warnings) and errors from the remote/client interpreter back to the host-side CubitPy API, plus a regression test to verify behavior.

Changes:

  • Wrapped client-to-host channel responses to include captured Cubit/Coreform messages and errors.
  • Host now emits captured messages via warnings.warn(...) and raises RuntimeError for captured errors.
  • Added a test asserting that a known warning is surfaced as a Python warning and a known Cubit error becomes a Python exception.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/test_cubitpy.py Adds coverage to ensure Cubit warnings/errors propagate through CubitPy APIs.
src/cubitpy/cubit_wrapper/cubit_wrapper_host.py Interprets wrapped client responses; converts messages to warnings and errors to exceptions.
src/cubitpy/cubit_wrapper/cubit_wrapper_client.py Introduces message handler + channel_send wrapper to ship messages/errors alongside return values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cubitpy/cubit_wrapper/cubit_wrapper_client.py
Comment thread src/cubitpy/cubit_wrapper/cubit_wrapper_client.py
Comment thread src/cubitpy/cubit_wrapper/cubit_wrapper_host.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/cubitpy/cubit_wrapper/cubit_wrapper_host.py
Comment thread tests/test_cubitpy.py
@isteinbrecher isteinbrecher merged commit e9904e2 into imcs-compsim:main Jun 18, 2026
2 checks passed
@isteinbrecher isteinbrecher deleted the message-handler branch June 18, 2026 12:52
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.

2 participants