Catch exceptions and add corresponding pages