Consolidate error handling