You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routes/solid-start/v2/reference/config/solid-start.mdx
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,17 @@ solidStart({
139
139
140
140
Path to a module whose default export handles values thrown by server functions before SolidStart serializes them into a response.
141
141
142
-
The handler can report the original value and return a safer replacement for the client. Return `undefined` to preserve the original value. The module is bundled only into the server, so it can import server-only code.
142
+
The export is called synchronously with the thrown value, and its return value is not awaited, so it cannot be an `async` function.
143
+
144
+
- Return `undefined` or `null` to preserve the original value.
145
+
- Return a `Response` to have it handled as if the server function had thrown it.
146
+
- Return any other value to send it in place of the original. It reaches the client serialized along with its own properties, so a replacement meant to be safe must not carry internal detail.
147
+
148
+
Control flow arrives the same way errors do: a [thrown `redirect`](/solid-start/v2/advanced/return-responses) reaches the export as a `Response`. Return those unchanged, or a handler that replaces everything it sees turns redirects into errors.
149
+
150
+
Only server function calls made over the network reach the export. A server function called during rendering runs in process and throws straight to its caller, and errors from API routes never reach it either.
151
+
152
+
The module is bundled only into the server, so it can import server-only code.
0 commit comments