Skip to content

Commit da2d5eb

Browse files
committed
fix: add comment explaining error handling in FromQueryResult derive
1 parent a7bfac9 commit da2d5eb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sea-orm-macros/src/derives/from_query_result.rs

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ struct FromQueryResultItem {
1616
pub ident: Ident,
1717
}
1818

19+
/// Initially, we try to obtain the value for each field and check if it is an ordinary DB error
20+
/// (which we return immediatly), or a null error.
21+
///
22+
/// ### Background
23+
///
24+
/// Null errors do not necessarily mean that the deserialization as a whole fails,
25+
/// since structs embedding the current one might have wrapped the current one in an `Option`.
26+
/// In this case, we do not want to swallow other errors, which are very likely to
1927
struct TryFromQueryResultCheck<'a>(&'a FromQueryResultItem);
2028

2129
impl<'a> ToTokens for TryFromQueryResultCheck<'a> {

0 commit comments

Comments
 (0)