NuxtN
Nuxt9mo ago
9 replies
/home/liam

mask errors on nitro/server api endpoints

nuxt 3 docs make it sound like it's currently not possible to create error handlers for server endpoints, but I may be misunderstanding. I see that you can define a error.vue for non-accept: application/json requests, but anything that's json, it still renders the entire error.

in either case, I'm not sure if either work as expected, as I suspect both send the actual error back to the client. however, what if the error contains potentially sensitive data? how are you supposed to mask that so it sends a generic error back, not the actual, full, potentially sensitive error body back? do I have to mask any random potential calls on the server side, hoping I've captured each potential place that might throw errors?
Was this page helpful?