Switching on custom errors