improve key not found error

This commit is contained in:
Ruben Fiszel
2023-10-25 09:59:49 +02:00
parent 695ba18607
commit 6ee1addea3
+6 -2
View File
@@ -211,7 +211,9 @@ pub async fn transform_json_value(
.get_variable_value(path)
.await
.map(|x| json!(x))
.map_err(|_| Error::NotFound(format!("Variable {path} not found for `{name}`")))
.map_err(|e| {
Error::NotFound(format!("Variable {path} not found for `{name}`: {e}"))
})
}
Value::String(y) if y.starts_with("$res:") => {
let path = y.strip_prefix("$res:").unwrap();
@@ -226,7 +228,9 @@ pub async fn transform_json_value(
Some(job.id.to_string()),
)
.await
.map_err(|_| Error::NotFound(format!("Resource {path} not found for `{name}`")))
.map_err(|e| {
Error::NotFound(format!("Resource {path} not found for `{name}`: {e}"))
})
}
Value::String(y) if y.starts_with("$") => {
let flow_path = if let Some(uuid) = job.parent_job {