markSafeError / isSafeError
Marks error as safe to serialize to the client verbatim, opting it out
of production error sanitization (see handleServerFunctionRequest). Use
for errors whose message/properties are intentional client-facing content.
Returns the same value for convenient throw markSafeError(new Error(...)).
Import
import { markSafeError, isSafeError } from "@solidjs/web";markSafeError
Type signature
function markSafeError<E>(error: E): E;Parameters
error
- Type:
E
Common problems
isSafeError
Returns whether a value is branded as safe to serialize to a client.
Type signature
function isSafeError(value: unknown): value is Error;Parameters
value
- Type:
unknown