Describe the bug
Adding early error returns in build_entity_attrs_with_shape function causes multiple tests to fail.
To Reproduce
Steps to reproduce the behavior:
- Add early return in
jans-cedarling/cedarling/src/entity_builder/build_entity_attrs.rs and update jans-cedarling/cedarling/src/entity_builder/error.rs
- Run the tests with
cargo test -p cedarling
- Multiple tests that previously passed will now fail due to early error returns
To check add the below code:
- In
build_entity_attrs.rs line 153 add:
if !errs.is_empty() {
return Err(BuildAttrsErrorVec::from(errs));
}
impl From<Vec<BuildAttrsError>> for BuildAttrsErrorVec {
fn from(errs: Vec<BuildAttrsError>) -> Self {
Self(errs)
}
}
Expected behavior
Tests should continue to pass.
Additional context
The issue appears to be that the new early error return changes the flow of error handling. The existing code doesn't return errors so maybe this is wanted by design, and adding the early return may be redundant or interfering with the existing error handling logic.
Describe the bug
Adding early error returns in
build_entity_attrs_with_shapefunction causes multiple tests to fail.To Reproduce
Steps to reproduce the behavior:
jans-cedarling/cedarling/src/entity_builder/build_entity_attrs.rsand updatejans-cedarling/cedarling/src/entity_builder/error.rscargo test -p cedarlingTo check add the below code:
build_entity_attrs.rsline 153 add:error.rsadd:Expected behavior
Tests should continue to pass.
Additional context
The issue appears to be that the new early error return changes the flow of error handling. The existing code doesn't return errors so maybe this is wanted by design, and adding the early return may be redundant or interfering with the existing error handling logic.