提交 a1875d15 编写于 作者: I isidor

fixes #87605

上级 656fff3b
...@@ -303,9 +303,14 @@ export function registerCommands(): void { ...@@ -303,9 +303,14 @@ export function registerCommands(): void {
id: RESTART_FRAME_ID, id: RESTART_FRAME_ID,
handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => { handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
const debugService = accessor.get(IDebugService); const debugService = accessor.get(IDebugService);
const notificationService = accessor.get(INotificationService);
let frame = getFrame(debugService, context); let frame = getFrame(debugService, context);
if (frame) { if (frame) {
await frame.restart(); try {
await frame.restart();
} catch (e) {
notificationService.error(e);
}
} }
} }
}); });
......
...@@ -623,7 +623,13 @@ export class RawDebugSession implements IDisposable { ...@@ -623,7 +623,13 @@ export class RawDebugSession implements IDisposable {
} }
}); });
} }
}).then(undefined, err => Promise.reject(this.handleErrorResponse(err))); }).then(res => {
if (typeof res.success === 'boolean' && res.success === false) {
return Promise.reject(this.handleErrorResponse(res));
}
return res as R;
}, err => Promise.reject(this.handleErrorResponse(err)));
} }
private handleErrorResponse(errorResponse: DebugProtocol.Response): Error { private handleErrorResponse(errorResponse: DebugProtocol.Response): Error {
......
...@@ -160,10 +160,6 @@ export class ExpressionContainer implements IExpressionContainer { ...@@ -160,10 +160,6 @@ export class ExpressionContainer implements IExpressionContainer {
this.session = session; this.session = session;
try { try {
const response = await session.evaluate(expression, stackFrame ? stackFrame.frameId : undefined, context); const response = await session.evaluate(expression, stackFrame ? stackFrame.frameId : undefined, context);
if (response && response.success === false) {
this.value = response.message || '';
return false;
}
if (response && response.body) { if (response && response.body) {
this.value = response.body.result || ''; this.value = response.body.result || '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册