SERVER-8234: make invoke() throw on error (v8 only)