throw exception when err is passed to next #20

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
6 participants
@ghost

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);

+1

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

+1

Collaborator

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