Skip to content

improve(error-handling): return Result instead of panic#1

Open
AlexCzar wants to merge 1 commit intomainfrom
improve-error-handling-and-tests
Open

improve(error-handling): return Result instead of panic#1
AlexCzar wants to merge 1 commit intomainfrom
improve-error-handling-and-tests

Conversation

@AlexCzar
Copy link
Copy Markdown
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