MCPcopy Create free account
hub / github.com/microsoft/data-formulator / isSerializedError

Function isSerializedError

src/app/errorHandler.ts:25–32  ·  view source on GitHub ↗

* RTK createAsyncThunk serializes thrown errors into plain objects via * miniSerializeError(). These objects have {name, message, stack} but are * NOT Error instances. This type guard identifies them.

(value: unknown)

Source from the content-addressed store, hash-verified

23 * NOT Error instances. This type guard identifies them.
24 */
25function isSerializedError(value: unknown): value is { message: string } {
26 return (
27 typeof value === 'object' &&
28 value !== null &&
29 'message' in value &&
30 typeof (value as any).message === 'string'
31 );
32}
33
34/**
35 * Extract a human-readable error message from any error shape.

Callers 2

extractErrorMessageFunction · 0.85
handleApiErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected