"use strict";
//
//  Copyright (c) Microsoft Corporation. All rights reserved.
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObjectDisposedError = exports.SshChannelError = exports.SshReconnectError = exports.SshConnectionError = void 0;
class SshConnectionError extends Error {
    constructor(message, reason) {
        super(message);
        this.reason = reason;
    }
}
exports.SshConnectionError = SshConnectionError;
class SshReconnectError extends Error {
    constructor(message, reason) {
        super(message);
        this.reason = reason;
    }
}
exports.SshReconnectError = SshReconnectError;
class SshChannelError extends Error {
    constructor(message, reason) {
        super(message);
        this.reason = reason;
    }
}
exports.SshChannelError = SshChannelError;
class ObjectDisposedError extends Error {
    // eslint-disable-next-line @typescript-eslint/ban-types
    constructor(objectOrMessage) {
        var _a, _b;
        let message;
        if (typeof objectOrMessage === 'string') {
            // Custom message.
            message = objectOrMessage;
        }
        else if (typeof objectOrMessage === 'function') {
            // Constructor function (class name).
            // eslint-disable-next-line @typescript-eslint/ban-types
            message = objectOrMessage.name + ' disposed.';
        }
        else {
            // Disposable object - get its class name.
            message = ((_b = (_a = objectOrMessage === null || objectOrMessage === void 0 ? void 0 : objectOrMessage.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'Object ') + ' disposed.';
        }
        super(message);
    }
}
exports.ObjectDisposedError = ObjectDisposedError;
//# sourceMappingURL=https://github.com/VSCodium/sourcemaps/releases/download/stable-824c4c46a288b839f13b24022655329c2aeb9f81/node_modules-@microsoft-dev-tunnels-ssh-errors.js.map