From 96ecb2ed03e74e8113349d6748f0794eadf8b8dc Mon Sep 17 00:00:00 2001 From: Yuri Skorokhodov Date: Wed, 20 Nov 2019 12:14:09 +0300 Subject: [PATCH] Change error handling method --- src/chrome/breakpoints.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/chrome/breakpoints.ts b/src/chrome/breakpoints.ts index 2ab852d8c..f8a187be2 100644 --- a/src/chrome/breakpoints.ts +++ b/src/chrome/breakpoints.ts @@ -333,12 +333,12 @@ export class Breakpoints { { scriptId: script.scriptId, lineNumber: args.endLine, columnNumber: args.endColumn || 0 } : { scriptId: script.scriptId, lineNumber: args.line + 1, columnNumber: 0 }; - try { - const possibleBpResponse = await this.chrome.Debugger.getPossibleBreakpoints({ - start: { scriptId: script.scriptId, lineNumber: args.line, columnNumber: args.column || 0 }, - end, - restrictToFunction: false - }); + const possibleBpResponse = await this.chrome.Debugger.getPossibleBreakpoints({ + start: { scriptId: script.scriptId, lineNumber: args.line, columnNumber: args.column || 0 }, + end, + restrictToFunction: false + }); + if (possibleBpResponse.locations) { let breakpoints = possibleBpResponse.locations.map(loc => { return { line: loc.lineNumber, @@ -349,9 +349,7 @@ export class Breakpoints { const response = { breakpoints }; this.adapter.lineColTransformer.setBreakpointsResponse(response); return response as DebugProtocol.BreakpointLocationsResponse['body']; - } catch (e) { - // getPossibleBPs not supported - logger.log('breakpointsLocations failed: ' + e.message); + } else { return { breakpoints: [] }; } }