Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/content/docs/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ In the traditional approach you may throw any JavaScript error. However, using t

```ts
const rateLimit = os.middleware(async ({ next }) => {
throw new ORPCError('RATE_LIMITED', ({
throw new ORPCError('RATE_LIMITED', {
message: 'You are being rate limited',
data: { retryAfter: 60 }
}))
})
return next()
})

Expand Down Expand Up @@ -109,10 +109,10 @@ const rateLimit = base.middleware(async ({ next, errors }) => {
data: { retryAfter: 60 }
})
// OR --- both are equivalent
throw new ORPCError('RATE_LIMITED', ({
throw new ORPCError('RATE_LIMITED', {
message: 'You are being rate limited',
data: { retryAfter: 60 }
}))
})
return next()
})

Expand Down
2 changes: 1 addition & 1 deletion apps/content/docs/integrations/hono.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const app = new Hono()

const handler = new RPCHandler(router)

app.use('/rpc/*', createMiddleware(rpcHandler, {
app.use('/rpc/*', createMiddleware(handler, {
prefix: '/rpc',
context: async (c) => {
return {} // Provide initial context if needed
Expand Down