不要怂,就是干,撸起袖子干!

expose Sequelize Errors to API

1 parent 52a4befb
Showing with 10 additions and 0 deletions
...@@ -8,6 +8,7 @@ var url = require("url") ...@@ -8,6 +8,7 @@ var url = require("url")
, Transaction = require("./transaction") , Transaction = require("./transaction")
, TransactionManager = require('./transaction-manager') , TransactionManager = require('./transaction-manager')
, QueryTypes = require('./query-types') , QueryTypes = require('./query-types')
, sequelizeErrors = require('./errors')
module.exports = (function() { module.exports = (function() {
/** /**
...@@ -150,6 +151,15 @@ module.exports = (function() { ...@@ -150,6 +151,15 @@ module.exports = (function() {
}) })
/** /**
* Expose Sequelize Error types
*/
Sequelize.prototype.BaseError = Sequelize.BaseError =
sequelizeErrors.BaseError
Sequelize.prototype.ValidationError = Sequelize.ValidationError =
sequelizeErrors.ValidationError
/**
* Returns the specified dialect. * Returns the specified dialect.
* *
* @return {String} The specified dialect. * @return {String} The specified dialect.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!