Skip to content

Commit

Permalink
refactor(queries): construct FindError instead of returning a strin…
Browse files Browse the repository at this point in the history
…g error in executor

Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
  • Loading branch information
DCNick3 committed Aug 5, 2024
1 parent 7fdc428 commit d3d4763
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion smart_contract/executor/src/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,12 @@ pub mod role {
crate::data_model::query::builder::SingleQueryError::ExpectedOneGotNone,
) => {
// assuming that only a "not found" case is possible here
deny!($executor, "Role not found")
$executor.deny($crate::data_model::ValidationFail::QueryFailed(
$crate::data_model::query::error::QueryExecutionFail::Find(
$crate::data_model::query::error::FindError::Role(role_id.clone()),
),
));
return;
}
Err(_) => {
unreachable!();
Expand Down

0 comments on commit d3d4763

Please sign in to comment.