We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse_file
Please answer these questions before submitting your issue. Thanks!
// source code in 'parser/src/lib.rs' pub fn parse_file(filename: &str, code: Option<String>) -> Result<ast::Module, String> { create_session_globals_then(move || { let src = if let Some(s) = code { s } else { // the read file failed error message can not return. std::fs::read_to_string(filename).unwrap() }; .... }
// do not use unwrap() and return the error message. std::fs::read_to_string(filename).unwrap()
It will panic, instead of return error message.
kclvm version is 0.4.3; checksum: e07ed7af0d9bd1e86a3131714e4bd20c
The text was updated successfully, but these errors were encountered:
Fix(kclvm-parser): return loading file failed error message from meth… (
3cdb489
#237) Fix(kclvm-parser): return loading file failed error message from method `parse_file`. use `match` replace `unwrap`. issue #236
zong-zhe
No branches or pull requests
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
It will panic, instead of return error message.
4. What is your KusionStack components version? (Required)
kclvm version is 0.4.3; checksum: e07ed7af0d9bd1e86a3131714e4bd20c
The text was updated successfully, but these errors were encountered: