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.

Fail test if request in Before flow fails

See original GitHub issue

Describe the solution you’d like If a request in the Before flow fails, I would like the test to fail. This can be done by adding for each request in the before flow an optional parameter such as allow_failure: false while the default value would be true. If a request with the allow_failure: false fails, then fail the test; otherwise proceed.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
enudlercommented, Jan 13, 2020

It can be also implemented using the processors feature:

For example: function throwErrorOnError(requestParams, response, context, ee, next) { if (response.statusCode !== 200 || response.statusCode !== 201 || response.statusCode !== 204){ throw new Error('Stopping test'); } }

We will need to catch this errors and notify predator that test was aborted. Adding it to 1.3.0

0reactions
enudlercommented, Sep 26, 2020

I suggest aborting the test if a capture fails in the ‘before’ section Change need to be done in predator-runner

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling steps, counters, a new flow details experience ...
With error handling, you can define any number of steps to run after the failure of an action. This powerful new feature will...
Read more >
Other Examples of Error Handling in Flows - Salesforce Help
Request Corrections from Users: Draw a fault connector to a Screen element, where users can verify the values that they entered, make corrections,...
Read more >
Unit Testing Delays, Errors & Retries with Kotlin Flows - Medium
In our Repository, when an error occurs, we delay for 1 second before executing the flow block again. As we have delays in...
Read more >
Common Salesforce Flow Errors and How to Troubleshoot Them
If your flow is running in user mode, an error will be returned. How do you know which context your flow is running...
Read more >
How to Solve Salesforce Flow Errors
To avoid hitting a 'fault' altogether, you can use a Decision to check specific criteria before proceeding and loop the user back around...
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