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

merge shouldThrowTheException into shouldThrow #54

Merged
merged 2 commits into from
Aug 17, 2017

Conversation

AndreasVolkmann
Copy link
Collaborator

I noticed the shouldThrowTheException() method is kind of obsolete.

We can just make the shouldThrow return an ExceptionResult, which can be evaluated (withMessage) if needed, or disregarded.

Now the shouldThrow() covers both use cases, but is much shorter and easier to read.

Example:
func shouldThrow Exception::class withCause IOException::class

What do you think?

@MarkusAmshove
Copy link
Owner

Really nice find!

I'm on holiday at the moment and looking at the diff through my mobile phone.
Did you remove the "should throw the exception"? This might break some people's code.

I like the idea to use "should throw" for both cases and would propose to keep both ways (to be backwards compatible). It think it good way would be to mark the old way as deprecated and promote the new way in the documentation (without mentioning the old).

What do you think about doing it this way?

Sent from my Vernee Apollo Lite using FastHub

@AndreasVolkmann
Copy link
Collaborator Author

I was thinking about whether to remove it as well. I find your approach suitable and will update the PR soon. Enjoy your holiday.

@MarkusAmshove MarkusAmshove merged commit f348fe1 into MarkusAmshove:master Aug 17, 2017
@MarkusAmshove
Copy link
Owner

It took some time but I've now merged it back in and released it within 1.27 ;-) Thank you!

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.

2 participants