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

It is not possible to use hubConnection.start().then(onValue, onError) #26

Open
bart1998 opened this issue Jan 4, 2020 · 0 comments
Open

Comments

@bart1998
Copy link

bart1998 commented Jan 4, 2020

When i try to use hubConnection.start().then() and i let it connect to a non-existent server (causes an error offcourse) the application crashes with the following error:

Unhandled Exception: type 'GeneralError' is not a subtype of type 'Error' in type cast

This happends in the file hub_connection.dart on line 244.

completer.completeError(error as Error);

This line tries to cast the error to the type 'Error'. As a lot of the errors in this library are of type 'GeneralError', that fails.
As far as i know there is no reason that it casts to 'Error' as the same function is called with the type 'GeneralError' just a few lines above it.

completer.completeError(new GeneralError(
"Unexpected message type: ${invocationEvent.type}"));
}

A fix for this would be to remove the cast in line 244 of hub_connection.dart. Like this:

completer.completeError(error);

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

No branches or pull requests

1 participant