DRYer error handling