question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new keyword "error" for stoping a workflow with an error message

See original GitHub issue

We have been running into situations where the input data doesn’t fit the assumptions of the workflow. while might cause a downstream error to happen on its own, the error message accompanying this event usually doesn’t point at the correct source of the problem.

This could be resolved by some if statements in the wdl, running some sanity checks on the input, but then there is no way to gracefully and informatively fail. An error keyword would allow authors to fail a workflow without having to spin up a vm that fails (i.e. returns error code 1) in order to inform the user of the true reason for failure.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
pshapiro4broadcommented, Nov 27, 2018

Personally I don’t see a great value in the form

  Int y = if x > 5 then x else error("Input x was not good")

Which is syntactic sugar for

  if (!(x > 5)) {
    error("Input x was not good")
  }
  Int y = x

Adding this form would require addressing the concept of functions that never return, like error(), and what type they are. The gain here is not worth the extra effort, IMO.

I agree that form like error(String) makes more sense than error(String, Boolean)

2reactions
cjllanwarnecommented, Nov 27, 2018

@rhpvorderman I think the “boolean” part could be handled by the existing if { } and if / then / else constructs. I agree that supplying a message along with the error would be nice.

Eg in workflows?

workflow foo {
  call task_a
  if (!task_a.good_result) {
    error("task_a's result was not good")
  }
}

And in tasks?

task foo {
  input {
    Int x
  }
  Int y = if x > 5 then x else error("Input x was not good")
  command {
    echo "I can guarantee you that ~{y} is greater than 5!"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

In DB Workflow Error - Designer - Alteryx Community
Hello , I have set of workflows with In DB Tools doing multiple joins and aggregations. all these workflows stopped working after running ......
Read more >
Foundations - Error Handling In Workflows - Microsoft Learn
To handle a fault, the first step is to define a scope of execution. In .NET code, this is accomplished with the try...
Read more >
Workflow error handling - ServiceNow Docs
The personalized JavaScript that users create in workflow activity variables is vulnerable to run-time syntax errors. Available error information is ...
Read more >
When is `new Error()` better than `Error()`? - Stack Overflow
1 Answer 1 · It looks like subclasses could implement the same behaviour if they wanted to, but there is no requirement for...
Read more >
Getting error "something went wrong. to try again, reload the ...
You may trigger a workflow first, get the error, then check the log ... If there are still too many logs, search with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found