feat(core): surface mid-session transport failures via lastError (#1489)
Closes #1323. Adds an `error`-event-driven `lastError` on useInspectorClient and a mid-session failure toast in App.tsx; the transport onerror is scoped to non-handshake (status !== connecting) so handshake failures stay on the connect() rejection path. Follow-up: #1490.
This commit is contained in:
parent
bb32d1db5f
commit
b4716a1405
1 changed files with 398 additions and 7 deletions
|
|
@ -61,6 +61,17 @@ export interface InspectorClientEventMap {
|
|||
fetchRequest: FetchRequestEntry;
|
||||
/** Fired when an in-flight fetch's response body is read asynchronously. */
|
||||
fetchRequestBodyUpdate: { id: string; responseBody: string };
|
||||
/**
|
||||
* Fired whenever the client transitions `status` to `"error"` from a path
|
||||
* that is NOT an awaited promise — i.e. a mid-session transport failure
|
||||
* (stdio subprocess crash, SSE stream drop, HTTP 5xx) surfaced via the
|
||||
* transport's `onerror`. The `Error` carries the reason (`.message`,
|
||||
* optional `.cause`). Handshake failures are NOT dispatched here: they
|
||||
* reject the awaited `connect()` promise, so the caller already has the
|
||||
* error and a second surface would double-report it. Consumers that don't
|
||||
* subscribe directly can read the last error via `useInspectorClient`'s
|
||||
* `lastError`.
|
||||
*/
|
||||
error: Error;
|
||||
resourceUpdated: { uri: string };
|
||||
progressNotification: Progress & { progressToken?: ProgressToken };
|
||||
|
|
|
|||
Loading…
Reference in a new issue