mirror of
https://github.com/fluencelabs/aquavm
synced 2025-03-16 04:50:49 +00:00
chore(execution-engine): replace IncompatibleJValueType with more specific FoldIteratesOverNonArray in fold (#502)
This commit is contained in:
parent
d28f674cdc
commit
47a7a87925
air/src/execution_step
@ -55,7 +55,7 @@ pub enum CatchableError {
|
||||
},
|
||||
|
||||
/// A fold instruction must iterate over array value.
|
||||
#[error("lambda '{1}' returned non-array value '{0}' for fold instruction")]
|
||||
#[error("expression '{1}' returned non-array value '{0}' for a fold iterable")]
|
||||
FoldIteratesOverNonArray(JValue, String),
|
||||
|
||||
/// This error type is produced by a match to notify xor that compared values aren't equal.
|
||||
|
@ -126,12 +126,7 @@ fn from_value(call_result: ValueAggregate, variable_name: &str) -> ExecutionResu
|
||||
array.len()
|
||||
}
|
||||
v => {
|
||||
return Err(CatchableError::IncompatibleJValueType {
|
||||
variable_name: variable_name.to_string(),
|
||||
actual_value: (*v).clone(),
|
||||
expected_value_type: "array",
|
||||
}
|
||||
.into());
|
||||
return Err(CatchableError::FoldIteratesOverNonArray((*v).clone(), variable_name.to_string()).into());
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user