提交 d553c86b 编写于 作者: I isidor

debug: show a link in error notifications

fixes #3591
上级 3e40c073
......@@ -592,13 +592,14 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
this.inDebugMode.set(true);
this.telemetryService.publicLog('debugSessionStart', { type: configuration.type, breakpointCount: this.model.getBreakpoints().length, exceptionBreakpoints: this.model.getExceptionBreakpoints() });
}).then(undefined, (error: Error) => {
}).then(undefined, (error: any) => {
this.telemetryService.publicLog('debugMisconfiguration', { type: configuration ? configuration.type : undefined });
if (this.session) {
this.session.disconnect();
}
return TPromise.wrapError(errors.create(error.message, { actions: [CloseAction, this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL)] }));
const actions = error.actions ? error.actions : [CloseAction, this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL)];
return TPromise.wrapError(errors.create(error.message, { actions }));
});
}
......
......@@ -8,6 +8,7 @@ import cp = require('child_process');
import fs = require('fs');
import net = require('net');
import platform = require('vs/base/common/platform');
import { Action } from 'vs/base/common/actions';
import errors = require('vs/base/common/errors');
import { TPromise } from 'vs/base/common/winjs.base';
import severity from 'vs/base/common/severity';
......@@ -16,8 +17,9 @@ import debug = require('vs/workbench/parts/debug/common/debug');
import { Adapter } from 'vs/workbench/parts/debug/node/debugAdapter';
import v8 = require('vs/workbench/parts/debug/node/v8Protocol');
import stdfork = require('vs/base/node/stdFork');
import { IMessageService } from 'vs/platform/message/common/message';
import { IMessageService, CloseAction } from 'vs/platform/message/common/message';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { shell } from 'electron';
export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSession {
private serverProcess: cp.ChildProcess;
......@@ -65,6 +67,14 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this.telemtryAdapter.log('debugProtocolErrorResponse', { error: message });
}
if (error && error.url) {
const label = error.urlLabel ? error.urlLabel : nls.localize('moreInfo', "More Info");
return TPromise.wrapError(errors.create(message, { actions: [CloseAction, new Action('debug.moreInfo', label, null, true, () => {
shell.openExternal(error.url);
return TPromise.as(null);
})]}));
}
return TPromise.wrapError(new Error(message));
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册