unify error handler api