Repository navigation
V9 refactoring and cleanup - #732
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). www – ./www🔍 Inspect: https://vercel.com/trpc/www/9ocnssrTJBNMfbpkMu2KUNoTuDs1 todomvc – ./examples/next-prisma-todomvc🔍 Inspect: https://vercel.com/trpc/todomvc/4AtubuWG1U2EufXWfFgy9zpEqGcL |
# Conflicts: # packages/server/test/index.test.tsx # packages/server/test/middleware.test.ts # www/docs/server/authorization.md
# Conflicts: # packages/server/test/middleware.test.ts
| BAD_REQUEST: 400, | ||
| METHOD_NOT_FOUND: 405, | ||
| PATH_NOT_FOUND: 404, | ||
| NOT_FOUND: 404, |
There was a problem hiding this comment.
Why no 405 METHOD_NOT_ALLOWED?
| async resolve({ ctx }) { | ||
| if (!ctx.user) { | ||
| throw trpc.httpError.unauthorized(); | ||
| throw new TRPCError({ code: 'UNAUTHORIZED' }); |
Think this PR along with #718 settles what I want to do with the next major update.
Keen to have any input on other fundamentals people / API surfaces or shapes that people think should change (including if you disagree with the changes here) - ping @cyrus-za / @anthonyshort / @peterp / @mmkal .
Summary of changes
TRPCErrors -METHOD_NOT_FOUNDremoved &PATH_NOT_FOUNDrenamed toNOT_FOUND(closes ReduceTRPCError-codes #733)httpErrors-helper?inputto be an array - now assuming aRecord<number, unknown>-style dict (changed with backwards compat in fix: batching with zod.optional()input #669)POSTcalls being{ input: x }(originally from flatten post requests'input#671)