Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Include address in error message when address already in use (#1086) #1143

Merged
merged 1 commit into from
Oct 5, 2016

Conversation

cesarblum
Copy link
Contributor

@cesarblum
Copy link
Contributor Author

@khellang

{
if ((ex.InnerException as UvException)?.StatusCode == Constants.EADDRINUSE)
{
throw new IOException($"Failed to bind to address {parsedAddress}: address already in use.", ex);
Copy link
Member

Choose a reason for hiding this comment

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

IOException? Would WebListener throw an IOException?

Copy link
Member

Choose a reason for hiding this comment

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

Startup is weird, there's really no standard exception you can throw. IO isn't terrible, at least it's related to the socket.

Copy link
Member

Choose a reason for hiding this comment

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

@Tratcher Do you know what WebListener would throw?

Copy link
Member

Choose a reason for hiding this comment

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

it's just a WebListenerException

Copy link
Member

Choose a reason for hiding this comment

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

It's technically a breaking change not to keep this a AggregateException/UvException, but AggregateExceptions are gross enough that I don't think anyone is catching that explicitly. I guess IOException is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think this is fine. Doesn't seem like a case where someone would catch the specific exception anyway (or at all).

Copy link
Contributor

@khellang khellang left a comment

Choose a reason for hiding this comment

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

Nice :shipit:

{
if ((ex.InnerException as UvException)?.StatusCode == Constants.EADDRINUSE)
{
throw new IOException($"Failed to bind to address {parsedAddress}: address already in use.", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think this is fine. Doesn't seem like a case where someone would catch the specific exception anyway (or at all).

@cesarblum cesarblum force-pushed the cesarbs/address-in-eaddrinuse branch from 2a7277d to 2c94884 Compare October 5, 2016 21:23
@cesarblum cesarblum merged commit 2c94884 into dev Oct 5, 2016
@cesarblum cesarblum deleted the cesarbs/address-in-eaddrinuse branch October 5, 2016 21:31
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.

6 participants