mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Log original kerberos errors to console (#8804)
* Log original kerberos errors to console for debugging purposes * Fix compile error
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user