Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve serial error logging
  • Loading branch information
microbit-robert committed Nov 13, 2024
commit a9950364b650947aae95bb84adf0d6425ba91c9e
2 changes: 1 addition & 1 deletion lib/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class DeviceConnectionEventMap {
"status": ConnectionStatusEvent;
"serialdata": SerialDataEvent;
"serialreset": Event;
"serialerror": Event;
"serialerror": SerialErrorEvent;
"flash": Event;
"beforerequestdevice": Event;
"afterrequestdevice": Event;
Expand Down
5 changes: 3 additions & 2 deletions lib/usb-radio-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
DeviceConnection,
DeviceConnectionEventMap,
SerialDataEvent,
SerialErrorEvent,
} from "./device.js";
import { TypedEventTarget } from "./events.js";
import { Logging, NullLogging } from "./logging.js";
Expand Down Expand Up @@ -223,8 +224,8 @@ class RadioBridgeSerialSession {
private connectionCheckIntervalId: ReturnType<typeof setInterval> | undefined;
private isRestartingConnection: boolean = false;

private serialErrorListener = (e: unknown) => {
this.logging.error("Serial error", e);
private serialErrorListener = (event: SerialErrorEvent) => {
this.logging.error("SerialError:", event.error);
void this.dispose();
};

Expand Down