Skip to content

Commit

Permalink
fix: check error type
Browse files Browse the repository at this point in the history
  • Loading branch information
grahambates committed Nov 19, 2023
1 parent ada360c commit 6af9455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/breakpointManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ class BreakpointManager {
const type = accessType ? types[accessType] : BreakpointCode.ACCESS;
await this.gdb.removeBreakpoint(address, type, ref.size);
} catch (err) {
logger.error((err as Error).message);
if (err instanceof Error) {
logger.error(err.message);
}
}
}
this.dataBreakpoints.clear();
Expand Down
4 changes: 3 additions & 1 deletion src/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ export class UAEDebugSession extends LoggingDebugSession {
} catch (err) {
this.sendEvent(new TerminatedEvent());
response.success = false;
response.message = (err as Error).message;
if (err instanceof Error) {
response.message = err.message;
}
}

this.sendResponse(response);
Expand Down

0 comments on commit 6af9455

Please sign in to comment.