Permalink
Browse files

Added error handling for no transport cases

Fixed #485
  • Loading branch information...
NTaylorMullen committed Aug 2, 2012
1 parent 2fa8af2 commit 2374572faa1512264549e94cc0ecad7cd73ec390
@@ -222,7 +222,10 @@
if (index >= transports.length) {
if (!connection.transport) {
// No transport initialized successfully
+ $(connection).trigger(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
+ // Stop the connection if it has connected and move it into the disconnected state
+ connection.stop();
}
return;
}
@@ -223,7 +223,10 @@
if (index >= transports.length) {
if (!connection.transport) {
// No transport initialized successfully
+ $(connection).trigger(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
+ // Stop the connection if it has connected and move it into the disconnected state
+ connection.stop();
}
return;
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -223,7 +223,10 @@
if (index >= transports.length) {
if (!connection.transport) {
// No transport initialized successfully
+ $(connection).trigger(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
+ // Stop the connection if it has connected and move it into the disconnected state
+ connection.stop();
}
return;
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -223,7 +223,10 @@
if (index >= transports.length) {
if (!connection.transport) {
// No transport initialized successfully
+ $(connection).trigger(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");
+ // Stop the connection if it has connected and move it into the disconnected state
+ connection.stop();
}
return;
}

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 2374572

Please sign in to comment.