diff --git a/src/chrome/chromeDebugAdapter.ts b/src/chrome/chromeDebugAdapter.ts index d67a0e2ac..0dab3df9a 100644 --- a/src/chrome/chromeDebugAdapter.ts +++ b/src/chrome/chromeDebugAdapter.ts @@ -392,8 +392,10 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter { // Enforce that the stopped event is not fired until we've send the response to the step that induced it. // Also with a timeout just to ensure things keep moving - const sendStoppedEvent = () => - this._session.sendEvent(new StoppedEvent(this.stopReasonText(reason), /*threadId=*/ChromeDebugAdapter.THREAD_ID)); + const sendStoppedEvent = () => { + const exceptionText = this._exception && this._exception.description && utils.firstLine(this._exception.description); + return this._session.sendEvent(new StoppedEvent(this.stopReasonText(reason), /*threadId=*/ChromeDebugAdapter.THREAD_ID, exceptionText)); + } return utils.promiseTimeout(this._currentStep, /*timeoutMs=*/300) .then(sendStoppedEvent, sendStoppedEvent); } diff --git a/src/utils.ts b/src/utils.ts index 05470284c..23710d167 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -507,3 +507,11 @@ export function makeRegexMatchPath(regex: RegExp, aPath: string): RegExp { export type Partial = { [P in keyof T]?: T[P]; }; + +export function getLine(msg: string, n = 0): string { + return msg.split('\n')[n]; +} + +export function firstLine(msg: string): string { + return getLine(msg); +} \ No newline at end of file