Use an exception handler to convert php errors into exceptions