Skip to content

Use expect* methods more + some cleanup#314

Merged
mtdowling merged 1 commit into0.10from
use-more-expect
Mar 16, 2020
Merged

Use expect* methods more + some cleanup#314
mtdowling merged 1 commit into0.10from
use-more-expect

Conversation

@mtdowling
Copy link
Copy Markdown
Member

This commit uses the expectTrait methods and hasTrait methods more
instead of using .get(). This will give much more clear error messages
in the event of a logical error in code.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from srchase March 13, 2020 23:52
This commit uses the expectTrait methods and hasTrait methods more
instead of using .get(). This will give much more clear error messages
in the event of a logical error in code.

This also adds expect* methods that expect a shape to be of a specific
type. This cleans up a lot of call sites that were using an unsafe
.get() after calling .asBlob, asString, etc.
@mtdowling mtdowling requested a review from srchase March 14, 2020 01:04
return Optional.empty();
}

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesssss 🙌

@mtdowling mtdowling merged commit a44123e into 0.10 Mar 16, 2020
@mtdowling mtdowling deleted the use-more-expect branch March 25, 2020 03:35
@kstich kstich mentioned this pull request Apr 23, 2020
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.

3 participants