Skip to content

Commit c2439fb

Browse files
committed
chore(docs): tweaks
1 parent 7624ef8 commit c2439fb

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

apps/web/pages/comparisons/rpc-frameworks.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ const proc = zagora()
163163
```js
164164
const proc = os
165165
.errors({
166-
NOT_FOUND: z.object({ id: z.number() }),
166+
NOT_FOUND: {
167+
data: z.object({ id: z.number() })
168+
},
167169
RATE_LIMIT: {
168-
message: 'User exceeded quota'
169170
data: z.object({
170171
retryAfter: z.number(),
171172
}),
@@ -179,7 +180,10 @@ const proc = os
179180

180181
// Invalid error payload = VALIDATION_ERROR,
181182
// it is also reported immediately by TypeScript
182-
throw errors.RATE_LIMIT({ message: 'bruh', data: { wrongField: 'x' } });
183+
throw errors.RATE_LIMIT({
184+
message: 'User exceeded quota',
185+
data: { wrongField: 'x' }
186+
});
183187
// Caught at compile-time and runtime!
184188
});
185189
```

apps/web/pages/docs/typed-errors.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Returned when input, output, or error payload validation fails:
121121

122122
### UNKNOWN_ERROR
123123

124-
Returned when an untyped error is thrown:
124+
Returned when an untyped error is thrown (uncaught excception, TypeError, SyntaxError, anything inside the handler):
125125

126126
```js
127127
.handler(() => {
@@ -136,6 +136,8 @@ Returned when an untyped error is thrown:
136136
}
137137
```
138138

139+
**NOTE:** Currently, when there is a failure fired in Cache Adapter methods it throws that error kind too, but soon it will throw it's own kind.
140+
139141
## Error Validation
140142

141143
Error payloads are validated at runtime. Invalid payloads become `VALIDATION_ERROR`:

0 commit comments

Comments
 (0)