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: docs/docs/reference/errors.mdx
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Err(ForgeError::NotFound("User not found".to_string()))
46
46
|`limit`|`u32`| Configured request limit |
47
47
|`remaining`|`u32`| Tokens remaining (0 when exceeded) |
48
48
49
-
The HTTP response serializes only `retry_after_secs` in the `details` object. The `limit` and `remaining` fields are available in Rust but not included in the JSON response.
49
+
The HTTP response serializes only top-level `retry_after_secs`. The Svelte client exposes it as `retryAfterSecs`; Dioxus keeps the Rust field name `retry_after_secs`. The `limit` and `remaining` fields are available in Rust but not included in the JSON response.
50
50
51
51
## HTTP Response Format
52
52
@@ -86,7 +86,11 @@ Generated client includes error types:
86
86
exportinterfaceForgeError {
87
87
code:string;
88
88
message:string;
89
+
retryAfterSecs?:number;
89
90
details?:unknown;
91
+
isRateLimited():boolean;
92
+
isUnauthorized():boolean;
93
+
isValidation():boolean;
90
94
}
91
95
```
92
96
@@ -309,8 +313,8 @@ Handle on the frontend:
309
313
try {
310
314
awaitexpensiveQuery();
311
315
} catch (e) {
312
-
if (einstanceofForgeClientError&&e.code==='RATE_LIMITED') {
@@ -34,7 +34,7 @@ Forge captures analytics at two levels that get correlated automatically.
34
34
35
35
**Server-side auto-capture**: The function executor records every RPC call with its name, kind (query/mutation), duration, success/failure status, and the caller's identity. Jobs, crons, workflows, webhooks, and daemon runs emit `server_execution` events with the same shape. Auth failures and rate-limit rejections emit `track` events (`auth.failed`, `rate_limit.exceeded`) so dashboards surface attack patterns. All of this happens inside the framework, so your handler code stays clean.
36
36
37
-
**Client-side tracking**: The `ForgeSignals` class (Svelte) or `use_signals()` hook (Dioxus) runs in the browser and captures page views on SPA navigation, frontend errors (window.onerror, unhandled rejections), Web Vitals (LCP, CLS, INP, FCP, TTFB, navigation timing, long tasks), network online/offline transitions, and any custom events you send with `track()`. Events are batched locally, persisted to `localStorage` so they survive page reloads, and flushed to the server periodically, when the batch fills up, on `visibilitychange`/`pagehide`, or when the network returns after being offline.
37
+
**Client-side tracking**: The `ForgeSignals` class (Svelte) runs in the browser. The `use_signals()` hook (Dioxus) works across web, desktop, and mobile; browser-only auto-capture such as Web Vitals and `window.onerror` is enabled only on `wasm32`. Custom events and error reports work on every Dioxus target. Events are batched locally, persisted where platform storage is available, and flushed to the server periodically or when the batch fills up.
38
38
39
39
**Correlation**: Every client-initiated RPC call includes an `x-correlation-id` header. This ID links the frontend event (user clicked a button) to the backend execution (the mutation that ran). Error reports include the last correlation ID and a trail of breadcrumbs for reproduction.
40
40
@@ -130,6 +130,11 @@ Record a custom event with arbitrary properties.
130
130
signals.track('subscription_upgraded', { from: 'free', to: 'pro' });
0 commit comments