Skip to content

Returning rejected promises in HttpConnection #8315

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 4 commits into from
Mar 11, 2019

Conversation

mikaelm12
Copy link
Contributor

Fixes: #7465
We were throwing in places we should have been returned rejected promises.

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

Just a few things you should look at.

}

private constructTransport(transport: HttpTransportType) {
switch (transport) {
switch (transport) {
case HttpTransportType.WebSockets:
if (!this.options.WebSocket) {
throw new Error("'WebSocket' is not supported in your environment.");
Copy link
Member

Choose a reason for hiding this comment

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

What about this throw?

Copy link
Member

Choose a reason for hiding this comment

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

And the ones in resolveTransport and resolveUrl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Errors in constructTransport and resolveTransport are caught and aggregated into a rejected Promise. resolveUrl is only used in the constructor so that should be fine just throwing an error

@mikaelm12 mikaelm12 added area-signalr Includes: SignalR clients and servers and removed area-servers labels Mar 8, 2019
@mikaelm12 mikaelm12 merged commit 96764d2 into master Mar 11, 2019
@natemcmaster natemcmaster deleted the mikaelm12/BrokenPromises branch May 3, 2019 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants