mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -19,7 +19,7 @@ export interface ResolvedOptions {
|
||||
|
||||
export interface TunnelDescription {
|
||||
remoteAddress: { port: number, host: string };
|
||||
localAddress: string;
|
||||
localAddress: { port: number, host: string } | string;
|
||||
}
|
||||
export interface TunnelInformation {
|
||||
environmentTunnels?: TunnelDescription[];
|
||||
@@ -40,28 +40,24 @@ export enum RemoteAuthorityResolverErrorCode {
|
||||
|
||||
export class RemoteAuthorityResolverError extends Error {
|
||||
|
||||
public static isHandledNotAvailable(err: any): boolean {
|
||||
if (err instanceof RemoteAuthorityResolverError) {
|
||||
if (err._code === RemoteAuthorityResolverErrorCode.NotAvailable && err._detail === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return this.isTemporarilyNotAvailable(err);
|
||||
}
|
||||
|
||||
public static isTemporarilyNotAvailable(err: any): boolean {
|
||||
return (err instanceof RemoteAuthorityResolverError) && err._code === RemoteAuthorityResolverErrorCode.TemporarilyNotAvailable;
|
||||
}
|
||||
|
||||
public static isNoResolverFound(err: any): boolean {
|
||||
public static isNoResolverFound(err: any): err is RemoteAuthorityResolverError {
|
||||
return (err instanceof RemoteAuthorityResolverError) && err._code === RemoteAuthorityResolverErrorCode.NoResolverFound;
|
||||
}
|
||||
|
||||
public static isHandled(err: any): boolean {
|
||||
return (err instanceof RemoteAuthorityResolverError) && err.isHandled;
|
||||
}
|
||||
|
||||
public readonly _message: string | undefined;
|
||||
public readonly _code: RemoteAuthorityResolverErrorCode;
|
||||
public readonly _detail: any;
|
||||
|
||||
public isHandled: boolean;
|
||||
|
||||
constructor(message?: string, code: RemoteAuthorityResolverErrorCode = RemoteAuthorityResolverErrorCode.Unknown, detail?: any) {
|
||||
super(message);
|
||||
|
||||
@@ -69,6 +65,8 @@ export class RemoteAuthorityResolverError extends Error {
|
||||
this._code = code;
|
||||
this._detail = detail;
|
||||
|
||||
this.isHandled = (code === RemoteAuthorityResolverErrorCode.NotAvailable) && detail === true;
|
||||
|
||||
// workaround when extending builtin objects and when compiling to ES5, see:
|
||||
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
||||
if (typeof (<any>Object).setPrototypeOf === 'function') {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface RemoteTunnel {
|
||||
readonly tunnelRemoteHost: string;
|
||||
readonly tunnelLocalPort?: number;
|
||||
readonly localAddress: string;
|
||||
dispose(): void;
|
||||
dispose(silent?: boolean): void;
|
||||
}
|
||||
|
||||
export interface TunnelOptions {
|
||||
|
||||
Reference in New Issue
Block a user