Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 52a4befb
authored
Feb 07, 2014
by
Thanasis Polychronakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce the Sequelize signed Error Objects, starting with ValidatorError
1 parent
e807a7c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
lib/dao-validator.js
lib/errors.js
lib/dao-validator.js
View file @
52a4bef
var
Validator
=
require
(
"validator"
)
,
Utils
=
require
(
"./utils"
)
,
sequelizeError
=
require
(
"./errors"
)
var
DaoValidator
=
module
.
exports
=
function
(
model
,
options
)
{
options
=
options
||
{}
...
...
@@ -27,7 +28,7 @@ DaoValidator.prototype.validate = function() {
emitter
.
emit
(
'success'
)
})
.
error
(
function
(
err
)
{
var
error
=
new
Error
(
'Validation error'
)
var
error
=
new
sequelizeError
.
Validation
Error
(
'Validation error'
)
error
[
DaoValidator
.
RAW_KEY_NAME
]
=
[]
Utils
.
_
.
each
(
err
,
function
(
value
)
{
...
...
lib/errors.js
0 → 100644
View file @
52a4bef
/**
* @fileOverview The Error Objects produced by Sequelize.
*/
var
util
=
require
(
'util'
)
var
error
=
module
.
exports
=
{}
/**
* The Base Error all Sequelize Errors inherit from.
*
* @constructor
*/
error
.
BaseError
=
function
()
{
Error
.
call
(
this
)
};
util
.
inherits
(
error
.
BaseError
,
Error
)
/**
* Validation Error
*
* @constructor
*/
error
.
ValidationError
=
function
()
{
error
.
BaseError
.
call
(
this
)
};
util
.
inherits
(
error
.
ValidationError
,
error
.
BaseError
)
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment