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-handling): return Result instead of panic #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexCzar
Copy link
Owner

Instead of panicking return proper Results with custom error type.

This allows for better error messages and also increases testability, allowing for more comprehensive testing of validation errors.

Bring in test_case crate, which makes data-table driven tests possible and rewrite tests to take advantage of this.

Also fix a bug, where upper bound of the value range wasn't treated as valid speed option.

@AlexCzar AlexCzar force-pushed the improve-error-handling-and-tests branch 5 times, most recently from 810994f to 2032417 Compare March 15, 2021 22:18
Instead of panicking return proper Results with custom error type.

This allows for better error messages and also increases testability, allowing for more comprehensive testing of validation errors.

Bring in test_case crate, which makes data-table driven tests possible and rewrite tests to take advantage of this.

Also fix a bug, where upper bound of the value range wasn't treated as valid speed option.
@AlexCzar AlexCzar force-pushed the improve-error-handling-and-tests branch from 2032417 to fef89cc Compare March 15, 2021 22:24
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