Log original kerberos errors to console (#8804)

* Log original kerberos errors to console for debugging purposes

* Fix compile error
This commit is contained in:
Charles Gagnon
2020-01-03 15:30:42 -08:00
committed by GitHub
parent 8529b52e73
commit fa2fcf2e40
2 changed files with 7 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ import { CmsConnectionController } from 'sql/workbench/services/connection/brows
import { entries } from 'sql/base/common/collections';
import { find } from 'vs/base/common/arrays';
import { onUnexpectedError } from 'vs/base/common/errors';
import { ILogService } from 'vs/platform/log/common/log';
export interface IConnectionValidateResult {
isValid: boolean;
@@ -87,7 +88,8 @@ export class ConnectionDialogService implements IConnectionDialogService {
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IConfigurationService private _configurationService: IConfigurationService,
@IClipboardService private _clipboardService: IClipboardService,
@ICommandService private _commandService: ICommandService
@ICommandService private _commandService: ICommandService,
@ILogService private _logService: ILogService
) {
this.initializeConnectionProviders();
}
@@ -468,6 +470,8 @@ export class ConnectionDialogService implements IConnectionDialogService {
const helpLink = 'https://aka.ms/sqlopskerberos';
let actions: IAction[] = [];
if (!platform.isWindows && types.isString(message) && message.toLowerCase().indexOf('kerberos') > -1 && message.toLowerCase().indexOf('kinit') > -1) {
// Log the original error to console for debugging
this._logService.error(`Kerberos connection failure. Message : ${message} Message Details : ${messageDetails}`);
message = [
localize('kerberosErrorStart', "Connection failed due to Kerberos error."),
localize('kerberosHelpLink', "Help configuring Kerberos is available at {0}", helpLink),

View File

@@ -12,6 +12,7 @@ import { TestErrorMessageService } from 'sql/platform/errorMessage/test/common/t
import * as TypeMoq from 'typemoq';
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
import { NullLogService } from 'vs/platform/log/common/log';
suite('ConnectionDialogService tests', () => {
@@ -22,7 +23,7 @@ suite('ConnectionDialogService tests', () => {
setup(() => {
let errorMessageService = getMockErrorMessageService();
connectionDialogService = new ConnectionDialogService(undefined, undefined, errorMessageService.object,
undefined, undefined, undefined);
undefined, undefined, undefined, new NullLogService());
mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, {}, {}, new TestStorageService());
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
mockConnectionDialog = TypeMoq.Mock.ofType(ConnectionDialogWidget, TypeMoq.MockBehavior.Strict,