Unify error handling