private handleConnectionErrors()

in src/controllers/connectionManager.ts [324:367]


    private handleConnectionErrors(fileUri: string, connection: ConnectionInfo, result: ConnectionContracts.ConnectionCompleteParams): void {
        if (result.errorNumber && result.errorMessage && !Utils.isEmpty(result.errorMessage)) {
            // Check if the error is an expired password
            if (result.errorNumber === Constants.errorPasswordExpired || result.errorNumber === Constants.errorPasswordNeedsReset) {
                // TODO: we should allow the user to change their password here once corefx supports SqlConnection.ChangePassword()
                Utils.showErrorMsg(Utils.formatString(LocalizedConstants.msgConnectionErrorPasswordExpired, result.errorNumber, result.errorMessage));
            } else if (result.errorNumber !== Constants.errorLoginFailed) {
                Utils.showErrorMsg(Utils.formatString(LocalizedConstants.msgConnectionError, result.errorNumber, result.errorMessage));
            }
            connection.errorNumber = result.errorNumber;
            connection.errorMessage = result.errorMessage;
        } else {
            PlatformInformation.GetCurrent().then( platformInfo => {
                if (!platformInfo.isWindows && result.errorMessage && result.errorMessage.includes('Kerberos')) {
                    this.vscodeWrapper.showErrorMessage(
                        Utils.formatString(LocalizedConstants.msgConnectionError2, result.errorMessage),
                        LocalizedConstants.macOpenSslHelpButton)
                    .then(action => {
                        if (action && action === LocalizedConstants.macOpenSslHelpButton) {
                            opener(Constants.integratedAuthHelpLink);
                        }
                     });
                } else if (platformInfo.runtimeId === Runtime.OSX_10_11_64  &&
                result.messages.indexOf('Unable to load DLL \'System.Security.Cryptography.Native\'') !== -1) {
                     this.vscodeWrapper.showErrorMessage(Utils.formatString(LocalizedConstants.msgConnectionError2,
                     LocalizedConstants.macOpenSslErrorMessage), LocalizedConstants.macOpenSslHelpButton).then(action => {
                        if (action && action === LocalizedConstants.macOpenSslHelpButton) {
                            opener(Constants.macOpenSslHelpLink);
                        }
                     });
                } else {
                        Utils.showErrorMsg(Utils.formatString(LocalizedConstants.msgConnectionError2, result.messages));
                }
            });

        }
        this.statusView.connectError(fileUri, connection.credentials, result);
        this.vscodeWrapper.logToOutputChannel(
            Utils.formatString(
                LocalizedConstants.msgConnectionFailed,
                connection.credentials.host,
                result.errorMessage ? result.errorMessage : result.messages)
        );
    }