mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
fix: checking wrong state of the error
This commit is contained in:
committed by
Quentin Bourgerie
parent
9ccc03b02f
commit
c3db68298e
@@ -46,7 +46,7 @@ void zamalang::python::populateCompilerAPISubmodule(pybind11::module &m) {
|
||||
.def("run",
|
||||
[](CompilerEngine &engine, std::vector<uint64_t> args) {
|
||||
auto result = engine.run(args);
|
||||
if (!result) {
|
||||
if (!result) { // not an error
|
||||
llvm::errs()
|
||||
<< "Execution failed: " << result.takeError() << "\n";
|
||||
throw std::runtime_error(
|
||||
@@ -56,9 +56,9 @@ void zamalang::python::populateCompilerAPISubmodule(pybind11::module &m) {
|
||||
})
|
||||
.def("compile_fhe",
|
||||
[](CompilerEngine &engine, std::string mlir_input) {
|
||||
auto result = engine.compile(mlir_input);
|
||||
if (!result) {
|
||||
llvm::errs() << "Compilation failed: " << result << "\n";
|
||||
auto error = engine.compile(mlir_input);
|
||||
if (error) {
|
||||
llvm::errs() << "Compilation failed: " << error << "\n";
|
||||
throw std::runtime_error(
|
||||
"failed compiling, see previous logs for more info");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user