From 7d569b111207d2f9999f2cfa9e270b0c93dc9b9c Mon Sep 17 00:00:00 2001 From: David Khourshid Date: Fri, 16 Feb 2024 15:36:26 -0500 Subject: [PATCH] Do not crash on unhandled inspection event type --- .changeset/wicked-squids-argue.md | 5 +++++ src/createInspector.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/wicked-squids-argue.md diff --git a/.changeset/wicked-squids-argue.md b/.changeset/wicked-squids-argue.md new file mode 100644 index 0000000..965af9d --- /dev/null +++ b/.changeset/wicked-squids-argue.md @@ -0,0 +1,5 @@ +--- +"@statelyai/inspect": patch +--- + +Do not crash on unhandled inspection event type diff --git a/src/createInspector.ts b/src/createInspector.ts index ffc21f2..d0f48dd 100644 --- a/src/createInspector.ts +++ b/src/createInspector.ts @@ -213,8 +213,8 @@ export function convertXStateEvent( } satisfies StatelySnapshotEvent; } default: { - throw new Error( - `Invalid inspection event type: ${(inspectionEvent as any).type}` + console.warn( + `Unhandled inspection event type: ${(inspectionEvent as any).type}` ); } }