Skip to content

Commit 8900489

Browse files
authored
docs: fix variable name and remove extra parens (#264)
Loving the library. Just some small typos I noticed while reading the docs. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Refined error handling examples to improve clarity in illustrating error construction. - Updated middleware integration instructions to reflect current setup conventions without altering underlying functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 4fc998d commit 8900489

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/content/docs/error-handling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ In the traditional approach you may throw any JavaScript error. However, using t
2727

2828
```ts
2929
const rateLimit = os.middleware(async ({ next }) => {
30-
throw new ORPCError('RATE_LIMITED', ({
30+
throw new ORPCError('RATE_LIMITED', {
3131
message: 'You are being rate limited',
3232
data: { retryAfter: 60 }
33-
}))
33+
})
3434
return next()
3535
})
3636

@@ -109,10 +109,10 @@ const rateLimit = base.middleware(async ({ next, errors }) => {
109109
data: { retryAfter: 60 }
110110
})
111111
// OR --- both are equivalent
112-
throw new ORPCError('RATE_LIMITED', ({
112+
throw new ORPCError('RATE_LIMITED', {
113113
message: 'You are being rate limited',
114114
data: { retryAfter: 60 }
115-
}))
115+
})
116116
return next()
117117
})
118118

apps/content/docs/integrations/hono.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const app = new Hono()
1717

1818
const handler = new RPCHandler(router)
1919

20-
app.use('/rpc/*', createMiddleware(rpcHandler, {
20+
app.use('/rpc/*', createMiddleware(handler, {
2121
prefix: '/rpc',
2222
context: async (c) => {
2323
return {} // Provide initial context if needed

0 commit comments

Comments
 (0)