Updating logging on transport failure (#12026)
This commit is contained in:
parent
09722d1ce5
commit
a784f4575b
File diff suppressed because one or more lines are too long
|
|
@ -80,7 +80,10 @@ export class WebSocketTransport implements ITransport {
|
|||
// ErrorEvent is a browser only type we need to check if the type exists before using it
|
||||
if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) {
|
||||
error = event.error;
|
||||
} else {
|
||||
error = new Error("There was an error with the transport.");
|
||||
}
|
||||
|
||||
reject(error);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -213,12 +213,14 @@ describe("HttpConnection", () => {
|
|||
const connection = new HttpConnection("http://tempuri.org", options);
|
||||
await expect(connection.start(TransferFormat.Text))
|
||||
.rejects
|
||||
.toThrow("Unable to connect to the server with any of the available transports. WebSockets failed: null ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client.");
|
||||
.toThrow("Unable to connect to the server with any of the available transports. WebSockets failed: Error: There was an error with the transport. " +
|
||||
"ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client.");
|
||||
|
||||
expect(negotiateCount).toEqual(1);
|
||||
},
|
||||
"Failed to start the transport 'WebSockets': null",
|
||||
"Failed to start the connection: Error: Unable to connect to the server with any of the available transports. WebSockets failed: null ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client.");
|
||||
"Failed to start the transport 'WebSockets': Error: There was an error with the transport.",
|
||||
"Failed to start the connection: Error: Unable to connect to the server with any of the available transports. WebSockets failed: Error: There was an error with the transport. " +
|
||||
"ServerSentEvents failed: Error: 'ServerSentEvents' is disabled by the client. LongPolling failed: Error: 'LongPolling' is disabled by the client.");
|
||||
});
|
||||
|
||||
it("negotiate called again when transport fails to start and falls back", async () => {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ describe("WebSocketTransport", () => {
|
|||
|
||||
await expect(connectPromise)
|
||||
.rejects
|
||||
.toBeNull();
|
||||
.toThrow("There was an error with the transport.");
|
||||
expect(connectComplete).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue