Skip to content

#14188 GrpcInterface: Propagate parameter validation errors in command service#14195

Merged
magnesj merged 2 commits into
devfrom
fix/14188-grpc-command-nodiscard
Jun 10, 2026
Merged

#14188 GrpcInterface: Propagate parameter validation errors in command service#14195
magnesj merged 2 commits into
devfrom
fix/14188-grpc-command-nodiscard

Conversation

@magnesj

@magnesj magnesj commented Jun 9, 2026

Copy link
Copy Markdown
Member

Fixes #14188.

copyPdmObjectFromRipsToCaf returns std::expected<void, QString> (implicitly [[nodiscard]]), but its result was discarded in RiaGrpcCommandService::assignPdmObjectValues, producing build warning C4834.

Instead of silencing the warning, this propagates the error:

  • assignPdmObjectValues now returns std::expected<void, QString>.
  • The copyPdmObjectFromRipsToCaf result is returned directly, and the recursive call forwards failures.
  • Execute checks the result and returns a gRPC INVALID_ARGUMENT status (with telemetry) on failure, mirroring the existing pattern in RiaGrpcPdmObjectService.

As a result, parameter-validation errors are now surfaced to the Python client instead of being silently ignored, and the C4834 warning is resolved.

magnesj added 2 commits June 9, 2026 14:36
…d service

Make RiaGrpcCommandService::assignPdmObjectValues return std::expected<void, QString> so the result of copyPdmObjectFromRipsToCaf is no longer discarded. Validation failures are now propagated up and returned to the client as a gRPC INVALID_ARGUMENT status instead of being silently ignored. This also resolves the C4834 [[nodiscard]] build warning.
…lPdmObjectMethod

The return value of copyPdmObjectFromRipsToCaf was discarded when copying method parameters in CallPdmObjectMethod. Check the std::expected result and return a gRPC INVALID_ARGUMENT status (with telemetry and logging) when parameter validation fails, instead of silently proceeding to execute the method.
@magnesj
magnesj force-pushed the fix/14188-grpc-command-nodiscard branch from bb57cde to 0440a08 Compare June 9, 2026 12:46
@magnesj
magnesj requested a review from jonjenssen June 9, 2026 12:48
@magnesj
magnesj merged commit 714dda1 into dev Jun 10, 2026
20 of 21 checks passed
@magnesj
magnesj deleted the fix/14188-grpc-command-nodiscard branch June 10, 2026 10:35
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.

Build issue: RiaGrpcCommandService

2 participants