Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Infinite loop with multiple catch()'s #28

jfeldstein opened this Issue · 0 comments

1 participant


Should catch() not be used to catch errors after individual steps?

In my script, I have long Seq chains which perform multistep procedures, and I'd been using .catch() to respond to errors at multiple points in the chain. Turns out that when any error is encountered, the first catch in the chain is always the one that responds to it, even if execution has already passed that point. Afterwards, execution continues from that catch, often repeating chunks of the chain.

Seq = require('seq');

.seq(function() {
  this(null, 'hi');
  console.error("First catch", e);
  this('an error');
  console.log("Should not run, proceed to catch.");
  this(null, n);
  console.error("Second Catch", e);
  console.log("Continued after second catch.");
  this(null, n);
@yasuoza yasuoza referenced this issue from a commit in yasuoza/node-seq
@yasuoza yasuoza Catch error at individual step. For issue #28 02c9c8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.