Add comprehensive input validation and error handling#61
Merged
Conversation
Introduce custom exception classes (PhiloteValidationError, PhiloteServerError), parameter validation in discipline base classes, gRPC error propagation via context.abort() in all server RPC methods, and client-side input validation with gRPC error wrapping. Fix missing space in RemoteImplicitComponent error message.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Cover all previously uncovered error handling paths: PhiloteValidationError and general Exception branches in server RPC methods, gRPC error wrapping in all client methods, and num_par_fd validation in OpenMDAO components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PhiloteValidationError,PhiloteServerError) with backward-compatible inheritance fromValueErrorandRuntimeErroradd_input,add_output,add_option,declare_partials, etc.) checking types, shapes, units, and duplicatestry/exceptandcontext.abort()using appropriate status codes (INVALID_ARGUMENT,INTERNAL) so clients get clear error messages instead of opaqueUNKNOWNerrorsgrpc.RpcErrorintoPhiloteServerErrorfor actionable error messagesOpenMdaoSubProblem,RemoteExplicitComponent,RemoteImplicitComponent), utility functions (get_chunk_indices,get_flattened_view,PairDict), and thedeclare_optionshelperRemoteImplicitComponenterror message ("will notbe" -> "will not be")Closes #46
Test plan