mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
fix: script exception handle
This commit is contained in:
parent
142a62e371
commit
6c85b8717f
@ -41,9 +41,9 @@ pub fn use_script(script: String, config: Mapping) -> Result<(Mapping, Vec<(Stri
|
|||||||
}}"#
|
}}"#
|
||||||
);
|
);
|
||||||
let result: String = ctx.eval(code.as_str())?;
|
let result: String = ctx.eval(code.as_str())?;
|
||||||
// if result.starts_with("__error_flag__") {
|
if result.starts_with("__error_flag__") {
|
||||||
// anyhow::bail!(result.slice_unchecked(begin, end));
|
anyhow::bail!(result[15..].to_owned());
|
||||||
// }
|
}
|
||||||
if result == "\"\"" {
|
if result == "\"\"" {
|
||||||
anyhow::bail!("main function should return object");
|
anyhow::bail!("main function should return object");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user