Node.js: Improved exception errors for frontend