Skip to content

Commit

Permalink
handle dylib callback error; tag 0.5.0-a11
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Oct 20, 2021
1 parent 7170a3e commit fdc11ab
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit_runner"
version = "0.5.0-a10"
version = "0.5.0-a11"
authors = ["jiyinyiyong <jiyinyiyong@gmail.com>"]
edition = "2018"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcit/procs",
"version": "0.5.0-a10",
"version": "0.5.0-a11",
"main": "./lib/calcit.procs.js",
"devDependencies": {
"@types/node": "^16.10.5",
Expand Down
10 changes: 8 additions & 2 deletions src/bin/injection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,14 @@ pub fn callback_dylib_edn(xs: &CalcitItems) -> Result<Calcit, CalcitErr> {
let result = unsafe {
let lib = libloading::Library::new(&lib_name).expect("dylib not found");
let func: libloading::Symbol<EdnFfi> = lib.get(method.as_bytes()).expect("dy function not found");
let ret = func(ys.to_owned()).map_err(CalcitErr::use_string)?;
edn_to_calcit(&ret)
match func(ys.to_owned()) {
Ok(ret) => edn_to_calcit(&ret),
Err(e) => {
track::track_task_release();
println!("failed to call request: {}", e);
return Err(CalcitErr::use_string(e));
}
}
};
if let Calcit::Fn(_, def_ns, _, def_scope, args, body) = callback {
let r = runner::run_fn(&im::vector![result], &def_scope, &args, &body, &def_ns);
Expand Down
2 changes: 1 addition & 1 deletion ts-src/calcit.procs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// CALCIT VERSION
export const calcit_version = "0.5.0-a10";
export const calcit_version = "0.5.0-a11";

import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree";
import { parse, ICirruNode } from "@cirru/parser.ts";
Expand Down

0 comments on commit fdc11ab

Please sign in to comment.