diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index 540477a66e..e2019c7c7a 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -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), diff --git a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts index d67b7063c5..2b8f188843 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts @@ -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,