Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error validation infrastructure of Shape API #330

Merged
merged 10 commits into from
Mar 10, 2022
Merged

Conversation

hannobraun
Copy link
Owner

There's a ValidationError now that can be returned, if something fails to validate. Most of its variants are unused as of now, but I've decided to leave them in, to document my design intent.

Methods that already do validation are updated to return ValidationError. All other method return ValidationResult, but actually never return the error variant. I expect that most of them will start doing validation, and returning ValidationError, soon.

This is a continuation of my work on #242 and #280.

The intention is to return those from all `add_` methods of the `Shape`
API.
@hannobraun hannobraun enabled auto-merge March 10, 2022 18:08
No errors are actually returned yet. This will follow in upcoming steps.

This results in a lot of ugly `unwrap`s all over the code, but I think
that's a worthwhile trade-off. Those `unwrap`s will go away, as error
handling in the CAD kernel is cleaned up over time. The immediate
benefit is, that unit-testing the `Shape` API becomes easier.
I'm about to merge the "invalid" cases into those, and this makes sure
the name will still fit then.
@hannobraun hannobraun merged commit 3c9c85c into main Mar 10, 2022
@hannobraun hannobraun deleted the validation2 branch March 10, 2022 18:12
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.

1 participant