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

Commit 345eb898 by Simon Schick

refactor(errors): remove redundant stack trace capturing

1 parent ed9bf350
......@@ -9,7 +9,6 @@ class AssociationError extends BaseError {
constructor(message) {
super(message);
this.name = 'SequelizeAssociationError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -11,7 +11,6 @@ class BaseError extends Error {
constructor(message) {
super(message);
this.name = 'SequelizeBaseError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -15,7 +15,6 @@ class BulkRecordError extends BaseError {
this.name = 'SequelizeBulkRecordError';
this.errors = error;
this.record = record;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -15,7 +15,6 @@ class ConnectionError extends BaseError {
*/
this.parent = parent;
this.original = parent;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class AccessDeniedError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeAccessDeniedError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class ConnectionAcquireTimeoutError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeConnectionAcquireTimeoutError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class ConnectionRefusedError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeConnectionRefusedError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class ConnectionTimedOutError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeConnectionTimedOutError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class HostNotFoundError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeHostNotFoundError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class HostNotReachableError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeHostNotReachableError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class InvalidConnectionError extends ConnectionError {
constructor(parent) {
super(parent);
this.name = 'SequelizeInvalidConnectionError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -22,7 +22,6 @@ class DatabaseError extends BaseError {
* @type {string}
*/
this.sql = parent.sql;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -17,7 +17,6 @@ class ExclusionConstraintError extends DatabaseError {
this.constraint = options.constraint;
this.fields = options.fields;
this.table = options.table;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -19,7 +19,6 @@ class ForeignKeyConstraintError extends DatabaseError {
this.value = options.value;
this.index = options.index;
this.reltype = options.reltype;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class TimeoutError extends DatabaseError {
constructor(parent) {
super(parent);
this.name = 'SequelizeTimeoutError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -17,7 +17,6 @@ class UnknownConstraintError extends DatabaseError {
this.constraint = options.constraint;
this.fields = options.fields;
this.table = options.table;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class EagerLoadingError extends BaseError {
constructor(message) {
super(message);
this.name = 'SequelizeEagerLoadingError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class EmptyResultError extends BaseError {
constructor(message) {
super(message);
this.name = 'SequelizeEmptyResultError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class InstanceError extends BaseError {
constructor(message) {
super(message);
this.name = 'SequelizeInstanceError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -26,7 +26,6 @@ class OptimisticLockError extends BaseError {
* @type {object}
*/
this.where = options.where;
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class QueryError extends BaseError {
constructor(message) {
super(message);
this.name = 'SequelizeQueryError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -9,7 +9,6 @@ class SequelizeScopeError extends BaseError {
constructor(parent) {
super(parent);
this.name = 'SequelizeScopeError';
Error.captureStackTrace(this, this.constructor);
}
}
......
......@@ -30,7 +30,6 @@ class ValidationError extends BaseError {
} else if (this.errors.length > 0 && this.errors[0].message) {
this.message = this.errors.map(err => `${err.type || err.origin}: ${err.message}`).join(',\n');
}
Error.captureStackTrace(this, this.constructor);
}
/**
......
......@@ -19,7 +19,6 @@ class UniqueConstraintError extends ValidationError {
this.parent = options.parent;
this.original = options.parent;
this.sql = options.parent.sql;
Error.captureStackTrace(this, this.constructor);
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!