diff --git a/CHANGELOG.md b/CHANGELOG.md index 944740d..2dc9bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.1.4 +- 设置suppressFailure,防止调试异常退出; + # 0.1.3 - 取消异步查询; - 关闭查询失败警告; diff --git a/README.md b/README.md index b2953a0..4c47e36 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ - +# 0.1.4 +- 设置suppressFailure,防止调试异常退出; + # 0.1.3 - 取消异步查询; - 关闭查询失败警告; diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 7463d0c..66eff15 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -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)); diff --git a/src/mibase.ts b/src/mibase.ts index 7a3c4ce..bc66a9e 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -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 == "") { @@ -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();