more errors

This commit is contained in:
Ruben Fiszel
2022-07-30 01:10:01 +02:00
parent 3ad02f294f
commit ee08b2b352
3 changed files with 14 additions and 8 deletions

View File

@@ -1255,7 +1255,7 @@ pub async fn add_completed_job_error<E: ToString + std::fmt::Debug>(
false,
false,
Some(output_map.clone()),
format!("{}\n{}", logs, e.to_string()),
format!("\n{}\n{}", logs, e.to_string()),
)
.await?;
Ok((a, output_map))

View File

@@ -124,7 +124,12 @@ pub async fn update_flow_status_after_job_completion(
.bind(serde_json::json!(step_counter))
.bind(flow)
.fetch_one(&mut tx)
.await?;
.await
.map_err(|e| {
Error::InternalErr(format!(
"error during retrieval of stop_early_expr from state: {e}"
))
})?;
tracing::debug!("UPDATE: {:?}", new_status);
@@ -222,7 +227,7 @@ async fn skip_loop_failures<'c>(
flow: Uuid,
step: i32,
tx: &mut sqlx::Transaction<'c, sqlx::Postgres>,
) -> Result<Option<bool>, sqlx::Error> {
) -> Result<Option<bool>, Error> {
sqlx::query_as(
"
SELECT (raw_flow->'modules'->$1->'value'->>'skip_failures')::bool
@@ -235,6 +240,7 @@ async fn skip_loop_failures<'c>(
.fetch_one(tx)
.await
.map(|(v,)| v)
.map_err(|e| Error::InternalErr(format!("error during retrieval of skip_loop_failures: {e}")))
}
async fn compute_stop_early(

View File

@@ -52,15 +52,15 @@ export async function main() {
// let state = wmill.getInternalState()
// 2. Get the actual state from the external service
// let newState = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json()
// console.log(newState)
// 3. Compare the two states and update the internal state if necessary
// 3. Compare the two states and update the internal state
// wmill.setInternalState(newState)
// 4. Return the new ros
// return newState - state
// return range from (state to newState)
// You may refer to each row/value returned by the trigger script using
// flow_input._value
return [1,2,3]
// In subsequent scripts, you may refer to each row/value returned by the trigger script using
// 'flow_input._value'
}
`