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 345eb898
authored
Mar 23, 2019
by
Simon Schick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(errors): remove redundant stack trace capturing
1 parent
ed9bf350
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
0 additions
and
24 deletions
lib/errors/association-error.js
lib/errors/base-error.js
lib/errors/bulk-record-error.js
lib/errors/connection-error.js
lib/errors/connection/access-denied-error.js
lib/errors/connection/connection-acquire-timeout-error.js
lib/errors/connection/connection-refused-error.js
lib/errors/connection/connection-timed-out-error.js
lib/errors/connection/host-not-found-error.js
lib/errors/connection/host-not-reachable-error.js
lib/errors/connection/invalid-connection-error.js
lib/errors/database-error.js
lib/errors/database/exclusion-constraint-error.js
lib/errors/database/foreign-key-constraint-error.js
lib/errors/database/timeout-error.js
lib/errors/database/unknown-constraint-error.js
lib/errors/eager-loading-error.js
lib/errors/empty-result-error.js
lib/errors/instance-error.js
lib/errors/optimistic-lock-error.js
lib/errors/query-error.js
lib/errors/sequelize-scope-error.js
lib/errors/validation-error.js
lib/errors/validation/unique-constraint-error.js
lib/errors/association-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class AssociationError extends BaseError {
...
@@ -9,7 +9,6 @@ class AssociationError extends BaseError {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeAssociationError'
;
this
.
name
=
'SequelizeAssociationError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/base-error.js
View file @
345eb89
...
@@ -11,7 +11,6 @@ class BaseError extends Error {
...
@@ -11,7 +11,6 @@ class BaseError extends Error {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeBaseError'
;
this
.
name
=
'SequelizeBaseError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/bulk-record-error.js
View file @
345eb89
...
@@ -15,7 +15,6 @@ class BulkRecordError extends BaseError {
...
@@ -15,7 +15,6 @@ class BulkRecordError extends BaseError {
this
.
name
=
'SequelizeBulkRecordError'
;
this
.
name
=
'SequelizeBulkRecordError'
;
this
.
errors
=
error
;
this
.
errors
=
error
;
this
.
record
=
record
;
this
.
record
=
record
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection-error.js
View file @
345eb89
...
@@ -15,7 +15,6 @@ class ConnectionError extends BaseError {
...
@@ -15,7 +15,6 @@ class ConnectionError extends BaseError {
*/
*/
this
.
parent
=
parent
;
this
.
parent
=
parent
;
this
.
original
=
parent
;
this
.
original
=
parent
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/access-denied-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class AccessDeniedError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class AccessDeniedError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeAccessDeniedError'
;
this
.
name
=
'SequelizeAccessDeniedError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/connection-acquire-timeout-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class ConnectionAcquireTimeoutError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class ConnectionAcquireTimeoutError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeConnectionAcquireTimeoutError'
;
this
.
name
=
'SequelizeConnectionAcquireTimeoutError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/connection-refused-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class ConnectionRefusedError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class ConnectionRefusedError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeConnectionRefusedError'
;
this
.
name
=
'SequelizeConnectionRefusedError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/connection-timed-out-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class ConnectionTimedOutError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class ConnectionTimedOutError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeConnectionTimedOutError'
;
this
.
name
=
'SequelizeConnectionTimedOutError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/host-not-found-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class HostNotFoundError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class HostNotFoundError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeHostNotFoundError'
;
this
.
name
=
'SequelizeHostNotFoundError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/host-not-reachable-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class HostNotReachableError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class HostNotReachableError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeHostNotReachableError'
;
this
.
name
=
'SequelizeHostNotReachableError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/connection/invalid-connection-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class InvalidConnectionError extends ConnectionError {
...
@@ -9,7 +9,6 @@ class InvalidConnectionError extends ConnectionError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeInvalidConnectionError'
;
this
.
name
=
'SequelizeInvalidConnectionError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/database-error.js
View file @
345eb89
...
@@ -22,7 +22,6 @@ class DatabaseError extends BaseError {
...
@@ -22,7 +22,6 @@ class DatabaseError extends BaseError {
* @type {string}
* @type {string}
*/
*/
this
.
sql
=
parent
.
sql
;
this
.
sql
=
parent
.
sql
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/database/exclusion-constraint-error.js
View file @
345eb89
...
@@ -17,7 +17,6 @@ class ExclusionConstraintError extends DatabaseError {
...
@@ -17,7 +17,6 @@ class ExclusionConstraintError extends DatabaseError {
this
.
constraint
=
options
.
constraint
;
this
.
constraint
=
options
.
constraint
;
this
.
fields
=
options
.
fields
;
this
.
fields
=
options
.
fields
;
this
.
table
=
options
.
table
;
this
.
table
=
options
.
table
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/database/foreign-key-constraint-error.js
View file @
345eb89
...
@@ -19,7 +19,6 @@ class ForeignKeyConstraintError extends DatabaseError {
...
@@ -19,7 +19,6 @@ class ForeignKeyConstraintError extends DatabaseError {
this
.
value
=
options
.
value
;
this
.
value
=
options
.
value
;
this
.
index
=
options
.
index
;
this
.
index
=
options
.
index
;
this
.
reltype
=
options
.
reltype
;
this
.
reltype
=
options
.
reltype
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/database/timeout-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class TimeoutError extends DatabaseError {
...
@@ -9,7 +9,6 @@ class TimeoutError extends DatabaseError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeTimeoutError'
;
this
.
name
=
'SequelizeTimeoutError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/database/unknown-constraint-error.js
View file @
345eb89
...
@@ -17,7 +17,6 @@ class UnknownConstraintError extends DatabaseError {
...
@@ -17,7 +17,6 @@ class UnknownConstraintError extends DatabaseError {
this
.
constraint
=
options
.
constraint
;
this
.
constraint
=
options
.
constraint
;
this
.
fields
=
options
.
fields
;
this
.
fields
=
options
.
fields
;
this
.
table
=
options
.
table
;
this
.
table
=
options
.
table
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/eager-loading-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class EagerLoadingError extends BaseError {
...
@@ -9,7 +9,6 @@ class EagerLoadingError extends BaseError {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeEagerLoadingError'
;
this
.
name
=
'SequelizeEagerLoadingError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/empty-result-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class EmptyResultError extends BaseError {
...
@@ -9,7 +9,6 @@ class EmptyResultError extends BaseError {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeEmptyResultError'
;
this
.
name
=
'SequelizeEmptyResultError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/instance-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class InstanceError extends BaseError {
...
@@ -9,7 +9,6 @@ class InstanceError extends BaseError {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeInstanceError'
;
this
.
name
=
'SequelizeInstanceError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/optimistic-lock-error.js
View file @
345eb89
...
@@ -26,7 +26,6 @@ class OptimisticLockError extends BaseError {
...
@@ -26,7 +26,6 @@ class OptimisticLockError extends BaseError {
* @type {object}
* @type {object}
*/
*/
this
.
where
=
options
.
where
;
this
.
where
=
options
.
where
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/query-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class QueryError extends BaseError {
...
@@ -9,7 +9,6 @@ class QueryError extends BaseError {
constructor
(
message
)
{
constructor
(
message
)
{
super
(
message
);
super
(
message
);
this
.
name
=
'SequelizeQueryError'
;
this
.
name
=
'SequelizeQueryError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/sequelize-scope-error.js
View file @
345eb89
...
@@ -9,7 +9,6 @@ class SequelizeScopeError extends BaseError {
...
@@ -9,7 +9,6 @@ class SequelizeScopeError extends BaseError {
constructor
(
parent
)
{
constructor
(
parent
)
{
super
(
parent
);
super
(
parent
);
this
.
name
=
'SequelizeScopeError'
;
this
.
name
=
'SequelizeScopeError'
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
lib/errors/validation-error.js
View file @
345eb89
...
@@ -30,7 +30,6 @@ class ValidationError extends BaseError {
...
@@ -30,7 +30,6 @@ class ValidationError extends BaseError {
}
else
if
(
this
.
errors
.
length
>
0
&&
this
.
errors
[
0
].
message
)
{
}
else
if
(
this
.
errors
.
length
>
0
&&
this
.
errors
[
0
].
message
)
{
this
.
message
=
this
.
errors
.
map
(
err
=>
`
${
err
.
type
||
err
.
origin
}
:
${
err
.
message
}
`
).
join
(
',\n'
);
this
.
message
=
this
.
errors
.
map
(
err
=>
`
${
err
.
type
||
err
.
origin
}
:
${
err
.
message
}
`
).
join
(
',\n'
);
}
}
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
/**
/**
...
...
lib/errors/validation/unique-constraint-error.js
View file @
345eb89
...
@@ -19,7 +19,6 @@ class UniqueConstraintError extends ValidationError {
...
@@ -19,7 +19,6 @@ class UniqueConstraintError extends ValidationError {
this
.
parent
=
options
.
parent
;
this
.
parent
=
options
.
parent
;
this
.
original
=
options
.
parent
;
this
.
original
=
options
.
parent
;
this
.
sql
=
options
.
parent
.
sql
;
this
.
sql
=
options
.
parent
.
sql
;
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
}
}
}
}
...
...
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