sequelize/sequelize — pull request #934 by durango (2013-09-23 22:50:26+00:00)
Title: This commit adds a new DAOFactory option called onNullError

This option allows you to emit an error whenever using .find or .findAll methods
and the records returned are null/length of zero. The error option is valid
under any value except a boolean false.

Example:

var Users = sequelize.define('User', { ...dataTypes... }, {onNullError: 'Users
not found!'})

Users.find({where: {username: 'Bob'}}).error(function(err) {
// err would be Users not found!
})

This closes https://github.com/sequelize/sequelize/issues/272