From e78733308e7533a87d5d6c5a8f7d6bbc7c3437f3 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Sat, 23 Jul 2016 02:10:31 +0200 Subject: [PATCH] Added more error catches --- src/gdb.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gdb.ts b/src/gdb.ts index c84616c..3818915 100644 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -74,7 +74,11 @@ class GDBDebugSession extends MI2DebugSession { this.started = true; if (this.crashed) this.handlePause(undefined); + }, err => { + this.sendErrorResponse(response, 100, `Failed to start MI Debugger: ${err.toString()}`) }); + }, err => { + this.sendErrorResponse(response, 102, `Failed to SSH: ${err.toString()}`) }); } else { @@ -91,7 +95,11 @@ class GDBDebugSession extends MI2DebugSession { this.started = true; if (this.crashed) this.handlePause(undefined); + }, err => { + this.sendErrorResponse(response, 100, `Failed to Start MI Debugger: ${err.toString()}`) }); + }, err => { + this.sendErrorResponse(response, 103, `Failed to load MI Debugger: ${err.toString()}`) }); } } @@ -112,6 +120,8 @@ class GDBDebugSession extends MI2DebugSession { this.miDebugger.sendUserInput(command); }); this.sendResponse(response); + }, err => { + this.sendErrorResponse(response, 102, `Failed to attach: ${err.toString()}`) }); } else { @@ -121,6 +131,8 @@ class GDBDebugSession extends MI2DebugSession { this.miDebugger.sendUserInput(command); }); this.sendResponse(response); + }, err => { + this.sendErrorResponse(response, 101, `Failed to attach: ${err.toString()}`) }); } }