diff --git a/kclvm/api/Cargo.toml b/kclvm/api/Cargo.toml index fb9c980fe..8d53c50a3 100644 --- a/kclvm/api/Cargo.toml +++ b/kclvm/api/Cargo.toml @@ -45,3 +45,6 @@ criterion = "0.4.0" protoc-bin-vendored = "3.0.0" prost-build = "0.11.8" prost-wkt-build = {path = "../third-party/prost-wkt/wkt-build", version = "0.4.1"} + +[features] +llvm = ["kclvm-runner/llvm"] diff --git a/kclvm/api/src/service/capi.rs b/kclvm/api/src/service/capi.rs index ff5e76f5a..381ad1ca5 100644 --- a/kclvm/api/src/service/capi.rs +++ b/kclvm/api/src/service/capi.rs @@ -49,7 +49,7 @@ macro_rules! call { let res = serv_ref.$serv_name(&args); let result_byte = match res { Ok(res) => res.encode_to_vec(), - Err(err) => panic!("{}", err), + Err(err) => format!("ERROR:{}", err.to_string()).into_bytes(), }; *$result_len = result_byte.len(); CString::from_vec_unchecked(result_byte).into_raw()