1.设置suppressFailure,防止调试异常退出

This commit is contained in:
xuhong 2023-05-23 18:16:02 +08:00 committed by Haoyang Chen
parent 1a4ab63c1e
commit 0dd8d8b37c
4 changed files with 21 additions and 10 deletions

View File

@ -1,3 +1,6 @@
# 0.1.4
- 设置suppressFailure防止调试异常退出
# 0.1.3
- 取消异步查询;
- 关闭查询失败警告;

View File

@ -1,4 +1,6 @@
# 0.1.4
- 设置suppressFailure防止调试异常退出
# 0.1.3
- 取消异步查询;
- 关闭查询失败警告;

View File

@ -371,7 +371,7 @@ export class MI2 extends EventEmitter implements IBackend {
}
}
if (!handled && parsed.resultRecords && parsed.resultRecords.resultClass == "error") {
this.log("stderr", parsed.result("msg") || line);
// this.log("stderr", parsed.result("msg") || line);
}
if (parsed.outOfBandRecord) {
parsed.outOfBandRecord.forEach(record => {
@ -995,8 +995,8 @@ export class MI2 extends EventEmitter implements IBackend {
this.handlers[sel] = (node: MINode) => {
delete this.needOutput[sel];
if (node && node.resultRecords && node.resultRecords.resultClass === "error") {
if (suppressFailure) {
this.log("stderr", `WARNING: Error executing command '${command}'`);
if (!suppressFailure) {
//this.log("stderr", `WARNING: Error executing command '${command}'`);
resolve(node);
} else
reject(new MIError(node.result("msg") || "Internal error", command));

View File

@ -570,7 +570,8 @@ export class MI2DebugSession extends DebugSession {
};
this.sendResponse(response);
} catch (err) {
this.sendErrorResponse(response, 1, `Could not expand variable: ${err}`);
this.sendResponse(response);
//this.sendErrorResponse(response, 1, `Could not expand variable1: ${err}`);
}
} else if (typeof id == "string") {
// Variable members
@ -581,7 +582,8 @@ export class MI2DebugSession extends DebugSession {
try {
let expanded = expandValue(createVariable, variable.result("value"), id, variable);
if (!expanded) {
this.sendErrorResponse(response, 2, `Could not expand variable`);
this.sendResponse(response);
//this.sendErrorResponse(response, 2, `Could not expand variable`);
} else {
if (typeof expanded[0] == "string")
expanded = [
@ -597,7 +599,8 @@ export class MI2DebugSession extends DebugSession {
this.sendResponse(response);
}
} catch (e) {
this.sendErrorResponse(response, 2, `Could not expand variable: ${e}`);
this.sendResponse(response);
//this.sendErrorResponse(response, 2, `Could not expand variable3: ${e}`);
}
} catch (err) {
this.sendResponse(response);
@ -620,7 +623,8 @@ export class MI2DebugSession extends DebugSession {
};
this.sendResponse(response);
} catch (err) {
this.sendErrorResponse(response, 1, `Could not expand variable: ${err}`);
this.sendResponse(response);
//this.sendErrorResponse(response, 1, `Could not expand variable4: ${err}`);
}
} else if (id instanceof ExtendedVariable) {
const varReq = id;
@ -646,7 +650,8 @@ export class MI2DebugSession extends DebugSession {
}
const expanded = expandValue(createVariable, variable.result("value"), root, variable);
if (!expanded) {
this.sendErrorResponse(response, 15, `Could not expand variable`);
this.sendResponse(response);
//this.sendErrorResponse(response, 15, `Could not expand variable`);
} else {
if (typeof expanded == "string") {
if (expanded == "<nullptr>") {
@ -685,7 +690,8 @@ export class MI2DebugSession extends DebugSession {
}
}
} catch (e) {
this.sendErrorResponse(response, 14, `Could not expand variable: ${e}`);
this.sendResponse(response);
//this.sendErrorResponse(response, 14, `Could not expand variable5: ${e}`);
}
};
addOne();