diff --git a/apps/content/docs/error-handling.md b/apps/content/docs/error-handling.md index cba6ad19a..be1c5a1cc 100644 --- a/apps/content/docs/error-handling.md +++ b/apps/content/docs/error-handling.md @@ -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() }) @@ -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() }) diff --git a/apps/content/docs/integrations/hono.md b/apps/content/docs/integrations/hono.md index aa343bdac..8169ee116 100644 --- a/apps/content/docs/integrations/hono.md +++ b/apps/content/docs/integrations/hono.md @@ -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