Skip to content

Commit

Permalink
more verbose error
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Apr 25, 2024
1 parent fbcbb87 commit 351b75f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions merk/src/proofs/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ impl Query {
for key in conditional_keys.into_iter() {
if current_len > max_results {
return Err(Error::RequestAmountExceeded(format!(
"terminal keys limit exceeded for conditional subqueries, set max is {max_results}, current length is {current_len}",
"terminal keys limit exceeded for conditional subqueries, set max is \
{max_results}, current length is {current_len}",
)));
}
already_added_keys.insert(key.clone());
Expand All @@ -203,7 +204,9 @@ impl Query {
} else {
if current_len == max_results {
return Err(Error::RequestAmountExceeded(format!(
"terminal keys limit exceeded when subquery path but no subquery, set max is {max_results}, current length is {current_len}",
"terminal keys limit exceeded when subquery path but no \
subquery, set max is {max_results}, current length is \
{current_len}",
)));
}
// a subquery path but no subquery
Expand Down Expand Up @@ -249,7 +252,8 @@ impl Query {
}
if current_len > max_results {
return Err(Error::RequestAmountExceeded(format!(
"terminal keys limit exceeded for items, set max is {max_results}, current len is {current_len}",
"terminal keys limit exceeded for items, set max is {max_results}, \
current len is {current_len}",
)));
}
let mut path = current_path.clone();
Expand All @@ -268,7 +272,8 @@ impl Query {
} else {
if current_len == max_results {
return Err(Error::RequestAmountExceeded(format!(
"terminal keys limit exceeded when subquery path but no subquery, set max is {max_results}, current len is {current_len}",
"terminal keys limit exceeded when subquery path but no subquery, \
set max is {max_results}, current len is {current_len}",
)));
}
// a subquery path but no subquery
Expand Down Expand Up @@ -299,7 +304,8 @@ impl Query {
} else {
if current_len == max_results {
return Err(Error::RequestAmountExceeded(format!(
"terminal keys limit exceeded without subquery or subquery path, set max is {max_results}, current len is {current_len}",
"terminal keys limit exceeded without subquery or subquery path, set \
max is {max_results}, current len is {current_len}",
)));
}
result.push((path, key));
Expand Down

0 comments on commit 351b75f

Please sign in to comment.