throw exception when err is passed to next #20

wants to merge 1 commit into


None yet
6 participants

ghost commented Feb 13, 2013

The existing migrate module proceeds normally when err is passed into next().

This change will throw any error passed to next, which matches node conventions and allows for code like this:

if (err) next(err);


I was surprised when node-migrate didn't work this way

mhart commented May 17, 2013

Agreed, very suprising. I believe the offending code is in bin/migrate and lib/set.js:

// The migrate binary calls this with a null `fn`
Set.prototype.up = function(fn, migrationName){
  this.migrate('up', fn, migrationName);
Set.prototype.migrate = function(direction, fn, migrationName){
  var self = this;
  fn = fn || function(){}; // So this will just swallow the error...
  // ...


saxicek commented Jul 27, 2014



joaosa commented Dec 24, 2014

Closed in favor of #32

joaosa closed this Dec 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment