Moved the specific error cases to the 'default' case of the switch.