chaokunyang commented on code in PR #2765:
URL: https://github.com/apache/fory/pull/2765#discussion_r2429597924
##########
rust/fory-derive/src/object/read.rs:
##########
@@ -254,14 +254,14 @@ fn gen_read_compatible_match_arm_body(field: &Field,
var_name: &Ident) -> TokenS
let from_any_fn = format_ident!("from_any_internal_{}",
trait_name);
let helper_mod = format_ident!("__fory_trait_helpers_{}",
trait_name);
quote! {
- let ref_flag = context.reader.read_i8();
+ let ref_flag = context.reader.read_i8()?;
if ref_flag != fory_core::types::RefFlag::NotNullValue as i8 {
- panic!("Expected NotNullValue for trait object field");
+ bail!("Expected NotNullValue for trait object field");
Review Comment:
this should return `InvalidData` error with detailed message
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]