Skip to content

Send script blocking return refactor#520

Merged
urfeex merged 16 commits into
UniversalRobots:masterfrom
URJala:send_script_blocking_return_refactor
Jun 16, 2026
Merged

Send script blocking return refactor#520
urfeex merged 16 commits into
UniversalRobots:masterfrom
URJala:send_script_blocking_return_refactor

Conversation

@URJala

@URJala URJala commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

The method now throws in any case where it would previously return false.


Note

High Risk
Breaking API change for all sendScriptBlocking callers; robot script execution error paths now throw instead of returning false, which can change control flow in integrators.

Overview
PrimaryClient::sendScriptBlocking is now void: every former false outcome throws a typed UrException (e.g. TimeoutException, RobotModeException, SafetyModeException, RobotRuntimeException, RobotErrorCodeException, ReadOnlyInterfaceException, StreamNotConnectedException). Success is implied when the call returns normally.

Failure handling in sendScriptBlocking was reworked to build aggregated error messages, treat CRITICAL_FAULT like fault/violation during script execution, and map controller error 210 to ReadOnlyInterfaceException. Runtime failures are thrown as RobotRuntimeException with script context instead of only logging.

ReportLevel (plus reportLevelString) moved from the primary error-code message header into ur/datatypes.h, with CRITICAL_FAULT / DEVL_CRITICAL_FAULT added; PrimaryConsumer logging now covers those levels explicitly.

Docs, examples/send_script.cpp, and tests were updated for the exception-based API.

Reviewed by Cursor Bugbot for commit db63a4f. Bugbot is set up for automated code reviews on this repo. Configure here.

@urfeex urfeex linked an issue Jun 12, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.28814% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.94%. Comparing base (ca25b13) to head (db63a4f).

Files with missing lines Patch % Lines
include/ur_client_library/exceptions.h 69.23% 12 Missing ⚠️
src/primary/primary_client.cpp 95.00% 2 Missing ⚠️
include/ur_client_library/ur/datatypes.h 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #520      +/-   ##
==========================================
+ Coverage   78.87%   78.94%   +0.07%     
==========================================
  Files         116      116              
  Lines        6612     6688      +76     
  Branches     2920     2953      +33     
==========================================
+ Hits         5215     5280      +65     
- Misses       1031     1045      +14     
+ Partials      366      363       -3     
Flag Coverage Δ
check_version_ur10-3.15.8 11.92% <0.84%> (-1.21%) ⬇️
check_version_ur10e-10.11.0 11.24% <0.00%> (-0.24%) ⬇️
check_version_ur10e-5.15.2 11.29% <0.00%> (-0.51%) ⬇️
check_version_ur12e-10.12.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur12e-5.25.1 11.43% <0.00%> (-0.96%) ⬇️
check_version_ur15-10.12.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur15-5.25.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur16e-10.12.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur16e-5.25.1 11.43% <0.00%> (-0.15%) ⬇️
check_version_ur18-10.12.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur18-5.25.1 11.24% <0.00%> (-0.38%) ⬇️
check_version_ur20-10.12.1 11.29% <0.00%> (-0.14%) ⬇️
check_version_ur20-5.25.1 11.24% <0.00%> (-0.14%) ⬇️
check_version_ur3-3.14.3 11.24% <0.00%> (-1.87%) ⬇️
check_version_ur30-10.12.1 11.39% <0.00%> (-0.10%) ⬇️
check_version_ur30-5.25.1 11.24% <0.00%> (-0.61%) ⬇️
check_version_ur3e-10.11.0 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur3e-5.9.4 11.24% <0.00%> (-0.24%) ⬇️
check_version_ur5-3.15.8 11.24% <0.00%> (-1.20%) ⬇️
check_version_ur5e-10.11.0 11.24% <0.00%> (-0.14%) ⬇️
check_version_ur5e-5.12.8 11.29% <0.00%> (-0.56%) ⬇️
check_version_ur7e-10.11.0 11.24% <0.00%> (-0.14%) ⬇️
check_version_ur7e-5.22.2 11.24% <0.00%> (-0.56%) ⬇️
check_version_ur8long-10.12.1 11.24% <0.00%> (-0.19%) ⬇️
check_version_ur8long-5.25.1 11.29% <0.00%> (-0.29%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 84.05% <ø> (-1.15%) ⬇️
ur5-3.14.3 74.73% <87.28%> (+0.10%) ⬆️
ur5e-10.11.0 69.03% <87.28%> (-0.07%) ⬇️
ur5e-10.12.0 70.21% <87.28%> (+0.09%) ⬆️
ur5e-10.7.0 68.95% <87.28%> (+0.23%) ⬆️
ur5e-5.9.4 75.36% <87.28%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread src/primary/primary_client.cpp
Comment thread src/primary/primary_client.cpp
Comment thread examples/send_script.cpp Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 96e6804. Configure here.

Comment thread src/primary/primary_client.cpp Outdated
This way, every possible level has to be explicitly categorized.
@urfeex urfeex merged commit f1d0a85 into UniversalRobots:master Jun 16, 2026
52 of 63 checks passed
@urfeex urfeex added the enhancement New feature or request label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrimaryClient: Improve error handling / reporting in sendScriptBlocking

2 participants