Skip to content

Commit 3cfb440

Browse files
committed
fix: handle Error without 'CodeExpectedError' in CodeLLDB
After refactoring Error without name === 'CodeExpectedError' was not handled in CodeLLDB and this base error was thrown to upper levels and was not handled. Because of this some logic which already expected this error did not work correctly, i.e. HTAB
1 parent ebbbe52 commit 3cfb440

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/debugger.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,14 +1132,21 @@ export class CodeLLDBDebuggerFacade extends GenericDebuggerFacade {
11321132
}
11331133

11341134
handleCodeLLDBDebuggerError(error: unknown) {
1135-
/* DebuggerNotAvailableError may be already thrown by base class */
11361135
if (!(error && error instanceof Error)) {
11371136
return;
11381137
}
1139-
1140-
if (error.name === 'CodeExpectedError' && !(error instanceof DebuggerNotAvailableError)) {
1141-
throw new EvaluationError(error.message);
1138+
1139+
/* DebuggerNotAvailableError may be already thrown by super class */
1140+
if (error instanceof DebuggerNotAvailableError) {
1141+
return;
11421142
}
1143+
1144+
/*
1145+
* Earlier there was an error.name === 'CodeExpectedError' check,
1146+
* but for now extension supports vscode up to 1.80, which just
1147+
* throws base Error without any custom name.
1148+
*/
1149+
throw new EvaluationError(error.message);
11431150
}
11441151

11451152
async getVariables(frameId: number): Promise<dap.DebugVariable[]> {

0 commit comments

Comments
 (0)