kalempster
Subscription example not behaving like it should
Hey, I've recently wanted to make a subscription route and I've stumbled upon a problem. In the documentation it's said that you should return an
observable
with a callback that is triggered immediately. That however is not happening. I don't know if I don't understand this correctly of if the example is broken.
I'm using bun@1.1.10 with @trpc/server@11.0.0-rc.396.
The console.log
at the end prints []
and I thought the callback is triggered immediately. Any help would be appreciated.4 replies
Error types in catch block
Hey!
I have a mutation that I want to catch if the procedure throws an error, I'd like to get the code of the error ("UNAUTHORIZED", "FORBIDDEN" etc.) but TRCPClientError doesn't have full types (basically I can't access the code property). I saw a generic that you can pass to the error but I don't know what to pass as the generic to get the types.
Is there any way to do so?
3 replies