Custom error handler for 404s or 500s (xhr/html)

Signed-off-by: Christian Roth <christian.roth@port17.de>