Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
When BP times out, still respond to deal with microsoft/vscode#21731
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Mar 2, 2017
1 parent 68e5d0e commit ed4fc65
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,17 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {

const setBreakpointsPTimeout = utils.promiseTimeout(setBreakpointsPFailOnError, ChromeDebugAdapter.SET_BREAKPOINTS_TIMEOUT, 'Set breakpoints request timed out');

// Do just one setBreakpointsRequest at a time to avoid interleaving breakpoint removed/breakpoint added requests to Crdp.
// Do just one setBreakpointsRequest at a time to avoid interleaving breakpoint removed/breakpoint added requests to Crdp, which causes issues.
// Swallow errors in the promise queue chain so it doesn't get blocked, but return the failing promise for error handling.
this._setBreakpointsRequestQ = setBreakpointsPTimeout.catch(() => undefined);
return setBreakpointsPTimeout.then(body => {
this._setBreakpointsRequestQ = setBreakpointsPTimeout.catch(e => {
// Log the timeout, but any other error will be logged elsewhere
if (e.message && e.message.indexOf('timed out') >= 0) {
logger.error(e.stack);
}
});

// Return the setBP request, no matter how long it takes. It may take awhile in Node 7.5 - 7.7, see https://github.com/nodejs/node/issues/11589
return setBreakpointsPFailOnError.then(body => {
this._sourceMapTransformer.setBreakpointsResponse(body, requestSeq);
this._lineColTransformer.setBreakpointsResponse(body);
return body;
Expand Down

0 comments on commit ed4fc65

Please sign in to comment.