Fix LongPolling retry after poll timeout (#1654)

This commit is contained in:
BrennanConroy 2018-03-20 14:51:00 -07:00 committed by GitHub
parent 88b1cff273
commit 24f07ce791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}
}