-
We've used |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The reason why I currently don't allow custom HTTP codes is that I'm trying to be JSON-RPC compatible in the core as I try it to be independent of the transport layer. However, I do understand this is might seem a bit too restrictive and I'm open to suggestions on how to make it more flexible. Here's how the JSON-RPC codes are defined: https://github.com/trpc/trpc/blob/main/packages/server/src/rpc/codes.ts Ideas welcome! |
Beta Was this translation helpful? Give feedback.
The reason why I currently don't allow custom HTTP codes is that I'm trying to be JSON-RPC compatible in the core as I try it to be independent of the transport layer.
However, I do understand this is might seem a bit too restrictive and I'm open to suggestions on how to make it more flexible.
Here's how the JSON-RPC codes are defined: https://github.com/trpc/trpc/blob/main/packages/server/src/rpc/codes.ts
And here's the HTTP codes for each are mapped: https://github.com/trpc/trpc/blob/main/packages/server/src/http/internals/getHTTPStatusCode.ts
Ideas welcome!