Skip to content

Multi-address client: throw MalformedURLException instead of IllegalArgumentException #1955

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

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

MalformedURLException is more suitable for a use-case when an URL is
not in absolute-form.

Modifications:

  • Throw MalformedURLException instead of IllegalArgumentException;
  • Try-catch selectClient operation and return failed Single in case
    of an error;

Result:

StreamingUrlHttpClient try-catches all exception during client
selection and throws MalformedURLException when a non-absolute form
URL is provided.

…alArgumentException`

Motivation:

`MalformedURLException` is more suitable for a use-case when an URL is
not in absolute-form.

Modifications:

- Throw  `MalformedURLException` instead of `IllegalArgumentException`;
- Try-catch `selectClient` operation and return failed `Single` in case
of an error;

Result:

`StreamingUrlHttpClient` try-catches all exception during client
selection and throws `MalformedURLException` when a non-absolute form
URL is provided.
@idelpivnitskiy idelpivnitskiy self-assigned this Nov 15, 2021
@idelpivnitskiy idelpivnitskiy added the breaking-change PR with breaking changes, removed APIs or other binary incompatibilities. label Nov 15, 2021
@idelpivnitskiy
Copy link
Member Author

This code was reviewed and approved in #1924.

@idelpivnitskiy idelpivnitskiy merged commit 83530f2 into apple:main Nov 15, 2021
@idelpivnitskiy idelpivnitskiy deleted the MalformedURLException branch November 15, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change PR with breaking changes, removed APIs or other binary incompatibilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant