Handle panics and display error pages