Updated error class to pass the Exception for the 500 triggered event.