mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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 { entries } from 'sql/base/common/collections';
|
||||||
import { find } from 'vs/base/common/arrays';
|
import { find } from 'vs/base/common/arrays';
|
||||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||||
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
|
|
||||||
export interface IConnectionValidateResult {
|
export interface IConnectionValidateResult {
|
||||||
isValid: boolean;
|
isValid: boolean;
|
||||||
@@ -87,7 +88,8 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||||
@IConfigurationService private _configurationService: IConfigurationService,
|
@IConfigurationService private _configurationService: IConfigurationService,
|
||||||
@IClipboardService private _clipboardService: IClipboardService,
|
@IClipboardService private _clipboardService: IClipboardService,
|
||||||
@ICommandService private _commandService: ICommandService
|
@ICommandService private _commandService: ICommandService,
|
||||||
|
@ILogService private _logService: ILogService
|
||||||
) {
|
) {
|
||||||
this.initializeConnectionProviders();
|
this.initializeConnectionProviders();
|
||||||
}
|
}
|
||||||
@@ -468,6 +470,8 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
const helpLink = 'https://aka.ms/sqlopskerberos';
|
const helpLink = 'https://aka.ms/sqlopskerberos';
|
||||||
let actions: IAction[] = [];
|
let actions: IAction[] = [];
|
||||||
if (!platform.isWindows && types.isString(message) && message.toLowerCase().indexOf('kerberos') > -1 && message.toLowerCase().indexOf('kinit') > -1) {
|
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 = [
|
message = [
|
||||||
localize('kerberosErrorStart', "Connection failed due to Kerberos error."),
|
localize('kerberosErrorStart', "Connection failed due to Kerberos error."),
|
||||||
localize('kerberosHelpLink', "Help configuring Kerberos is available at {0}", helpLink),
|
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 * as TypeMoq from 'typemoq';
|
||||||
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
|
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
|
||||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||||
|
import { NullLogService } from 'vs/platform/log/common/log';
|
||||||
|
|
||||||
suite('ConnectionDialogService tests', () => {
|
suite('ConnectionDialogService tests', () => {
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ suite('ConnectionDialogService tests', () => {
|
|||||||
setup(() => {
|
setup(() => {
|
||||||
let errorMessageService = getMockErrorMessageService();
|
let errorMessageService = getMockErrorMessageService();
|
||||||
connectionDialogService = new ConnectionDialogService(undefined, undefined, errorMessageService.object,
|
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());
|
mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, {}, {}, new TestStorageService());
|
||||||
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
|
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
|
||||||
mockConnectionDialog = TypeMoq.Mock.ofType(ConnectionDialogWidget, TypeMoq.MockBehavior.Strict,
|
mockConnectionDialog = TypeMoq.Mock.ofType(ConnectionDialogWidget, TypeMoq.MockBehavior.Strict,
|
||||||
|
|||||||
Reference in New Issue
Block a user