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
Update the serverFunctions.onError reference (#1610)
* Update the `serverFunctions.onError` reference
* Document the failure semantics of the awaited `onError` handler
* Tighten the wording for a failing `onError` handler
Copy file name to clipboardExpand all lines: src/routes/solid-start/v2/reference/config/solid-start.mdx
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,11 +139,13 @@ solidStart({
139
139
140
140
-**Type:**`string`
141
141
142
-
Path to a module whose default export handles values thrown by server functions before SolidStart serializes them into a response.
142
+
Path to a module whose default export handles values thrown by server functions before SolidStart serializes them into a response. Only calls arriving over the network reach it. The module is bundled only into the server, so it can import server-only code.
143
143
144
-
The handler can report the original value and provide a safer replacement for the client. SolidStart awaits the handler before serializing the response, allowing a monitoring service to flush first.
144
+
The handler can report the original value and provide a safer replacement for the client. It may be `async`: SolidStart awaits it before serializing the response, so a monitoring service can flush first. If the handler itself throws or rejects, the original value is sent as if no handler were configured.
145
145
146
-
Returning or resolving to `undefined` or `null` preserves the original value. A `Response` preserves control flow, while any other value replaces the original. The module is bundled only into the server, so it can import server-only code.
146
+
- Return `undefined` or `null` to preserve the original value.
147
+
- Return a `Response` unchanged to pass it through, which keeps a thrown `redirect` working. See [Return Responses](/solid-start/v2/advanced/return-responses).
148
+
- Return any other value to send it in place of the original, serialized to the client along with its own properties.
147
149
148
150
```tsx title="vite.config.ts"
149
151
solidStart({
@@ -153,17 +155,21 @@ solidStart({
153
155
});
154
156
```
155
157
158
+
The module it names, `src/server-function-error.ts`:
0 commit comments