replicate the proper internal error-handling between http and higher
ES logic.