Fix LongPolling retry after poll timeout (#1654)
This commit is contained in:
parent
88b1cff273
commit
24f07ce791
|
|
@ -2,15 +2,29 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
export class HttpError extends Error {
|
export class HttpError extends Error {
|
||||||
|
// tslint:disable-next-line:variable-name
|
||||||
|
private __proto__: Error;
|
||||||
public statusCode: number;
|
public statusCode: number;
|
||||||
constructor(errorMessage: string, statusCode: number) {
|
constructor(errorMessage: string, statusCode: number) {
|
||||||
|
const trueProto = new.target.prototype;
|
||||||
super(errorMessage);
|
super(errorMessage);
|
||||||
this.statusCode = statusCode;
|
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 {
|
export class TimeoutError extends Error {
|
||||||
|
// tslint:disable-next-line:variable-name
|
||||||
|
private __proto__: Error;
|
||||||
constructor(errorMessage: string = "A timeout occurred.") {
|
constructor(errorMessage: string = "A timeout occurred.") {
|
||||||
|
const trueProto = new.target.prototype;
|
||||||
super(errorMessage);
|
super(errorMessage);
|
||||||
|
|
||||||
|
// Workaround issue in Typescript compiler
|
||||||
|
// https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
|
||||||
|
this.__proto__ = trueProto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue