How to hide database ip when using tRPC + Prisma

Solution:
can you remove the stack and the shape.message from the error before returning for the client?
Jump to solution
31 Replies
Neto
Netoā€¢17mo ago
check the log level but i think in production there will be no stacktrace
NekoChan
NekoChanā€¢17mo ago
you mean this? I didn't touch these before
Neto
Netoā€¢17mo ago
try building the app and starting and check the error next build next start
NekoChan
NekoChanā€¢17mo ago
NekoChan
NekoChanā€¢17mo ago
i change my db url to postgresql://postgres:test@test:1234/postgres, so you can see the error with db ip
Neto
Netoā€¢17mo ago
Error Handling | tRPC
Whenever an error occurs in a procedure, tRPC responds to the client with an object that includes an "error" property. This property contains all the information that you need to handle the error in the client.
Neto
Netoā€¢17mo ago
you can check dealing with errors on the trpc side of things before they bubble up to the next side of things
NekoChan
NekoChanā€¢17mo ago
NekoChan
NekoChanā€¢17mo ago
it still send the error to client
Neto
Netoā€¢17mo ago
there is a NODE_ENV in your .env.local file?
NekoChan
NekoChanā€¢17mo ago
no
NekoChan
NekoChanā€¢17mo ago
Neto
Netoā€¢17mo ago
try adding NODE_ENV=production and see what happens
NekoChan
NekoChanā€¢17mo ago
Want results from more Discord servers?
Add your server