From 24f07ce791f3e66c12c6c7b3ae60b45e76191cab Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 20 Mar 2018 14:51:00 -0700 Subject: [PATCH] Fix LongPolling retry after poll timeout (#1654) --- client-ts/signalr/src/Errors.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client-ts/signalr/src/Errors.ts b/client-ts/signalr/src/Errors.ts index 94c28d0be3..4e52f76aaf 100644 --- a/client-ts/signalr/src/Errors.ts +++ b/client-ts/signalr/src/Errors.ts @@ -2,15 +2,29 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. export class HttpError extends Error { + // tslint:disable-next-line:variable-name + private __proto__: Error; public statusCode: number; constructor(errorMessage: string, statusCode: number) { + const trueProto = new.target.prototype; super(errorMessage); this.statusCode = statusCode; + + // Workaround issue in Typescript compiler + // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 + this.__proto__ = trueProto; } } export class TimeoutError extends Error { + // tslint:disable-next-line:variable-name + private __proto__: Error; constructor(errorMessage: string = "A timeout occurred.") { + const trueProto = new.target.prototype; super(errorMessage); + + // Workaround issue in Typescript compiler + // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 + this.__proto__ = trueProto; } }