[NEXUS-7558] Resolve XSS issue with error pages
Simplify error page handling