Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tstivers1990
Copy link
Contributor

This pull request must be merged after #615 due to changes to Refit.Tests.InterfaceStubGenerator.GenerateTemplateInfoForInterfaceListSmokeTest

Closes #614

@tstivers1990
Copy link
Contributor Author

tstivers1990 commented Feb 17, 2019

@onovotny It seems System.Uri already throws exceptions when creating the Uri if an invalid string is passed, including an empty or whitespace string. Maybe it would be better to simply use the null conditional operator for the .TrimEnd() added by #615 and let System.Uri handle validating hostUrl? It simplifies the code and provides a more useful exception to the end user in my opinion.

@tstivers1990
Copy link
Contributor Author

Also worth noting is that if this PR is merged, it may be a breaking change. Users may have depended on the exceptions thrown by System.Uri and this change will break those users' code.

@tstivers1990 tstivers1990 force-pushed the 614-should-throw-argumentexception-if-hosturl-isnullorwhitespace branch from d0d26a4 to 89d9db7 Compare February 17, 2019 01:01
@tstivers1990
Copy link
Contributor Author

I've updated #615 to use the null-conditional operator so that this pull request can be made optional. Merging #615 without merging this pull request should be safe.

@clairernovotny clairernovotny merged commit f7ab7ef into reactiveui:master Feb 17, 2019
@lock lock bot locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RestService.For<T>(string hostUrl) should throw InvalidArgumentException if hostUrl IsNullOrWhiteSpace

2 participants