Disable full traceback of exception

I’m using frappe.throw(_("custom message")) to handle exceptions but I see the full traceback of exception. I want to disable this behaviour. How do I fix this ?

FYI, I have already changed Show Full Error and Allow Reporting of Issues to the Developer in System Settings. Didn’t help

frappe.throw should work can you share your code ?