More robust error reporting for failed invocations.