Error function trpc
Okay, so im kinda new to trpc stuff and not that familiar with that. I want to throw error on backend when Email is not unique. So when i write it like this in my router it works great, it throws that error:
but wanted to do it in more elegant way, and use util function like this and , but then i just got error i assume from that unique field in db and got 500, not my desired error which i throw in util function. What is wrong? also, dont really know how to type ctx in util function. Thanks
but wanted to do it in more elegant way, and use util function like this and , but then i just got error i assume from that unique field in db and got 500, not my desired error which i throw in util function. What is wrong? also, dont really know how to type ctx in util function. Thanks
1 Reply
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View