making error handler support more flexible