unify exception handling