diff --git a/deps/ReactantExtra/API.cpp b/deps/ReactantExtra/API.cpp index f64fd63829..b823bb1c64 100644 --- a/deps/ReactantExtra/API.cpp +++ b/deps/ReactantExtra/API.cpp @@ -840,8 +840,16 @@ ClientCompile(PjRtClient *client, MlirModule cmod, int64_t device_id, } } - auto exec = MyValueOrThrow(client->Compile(cmod_op, options)); - return exec.release(); + auto exec_err = client->Compile(cmod_op, options); + + if (!exec_err.ok()) { + std::string err_str; + llvm::raw_string_ostream err_stream(err_str); + err_stream << cmod_op << "\n"; + err_stream << exec_err.status().ToString(); + ReactantThrowError(err_stream.str().c_str()); + } + return std::move(exec_err).value().release(); } extern "C" void