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

Commit 1a76270e by David Pate

Moved the connection errors to after the Database and Validation errors so they …

…aren't breaking up the grouping.
1 parent 043502b9
Showing with 86 additions and 86 deletions
......@@ -94,92 +94,6 @@ error.DatabaseError.prototype.parent;
error.DatabaseError.prototype.sql;
/**
* A base class for all connection related errors.
* @extends BaseError
* @constructor
*/
error.ConnectionError = function (parent) {
error.BaseError.apply(this, [parent.message]);
this.name = 'SequelizeConnectionError';
this.parent = parent;
};
util.inherits(error.ConnectionError, error.BaseError);
/**
* The connection specific error which triggered this one
* @property parent
* @name parent
*/
error.ConnectionError.prototype.parent;
/**
* Thrown when a connection to a database is refused
* @extends ConnectionError
* @constructor
*/
error.ConnectionRefusedError = function (parent) {
error.ConnectionError.call(this, parent);
this.name = 'SequelizeConnectionRefusedError';
};
util.inherits(error.ConnectionRefusedError, error.ConnectionError);
/**
* Thrown when a connection to a database is refused due to insufficient privileges
* @extends ConnectionError
* @constructor
*/
error.AccessDeniedError = function (parent) {
error.AccessDeniedError.call(this, parent);
this.name = 'SequelizeAccessDeniedError';
};
util.inherits(error.AccessDeniedError, error.ConnectionError);
/**
* Thrown when a connection to a database has a hostname that was not found
* @extends ConnectionError
* @constructor
*/
error.HostNotFoundError = function (parent) {
error.HostNotFoundError.call(this, parent);
this.name = 'SequelizeHostNotFoundError';
};
util.inherits(error.HostNotFoundError, error.ConnectionError);
/**
* Thrown when a connection to a database has a hostname that was not reachable
* @extends ConnectionError
* @constructor
*/
error.HostNotReachableError = function (parent) {
error.HostNotReachableError.call(this, parent);
this.name = 'SequelizeHostNotReachableError';
};
util.inherits(error.HostNotReachableError, error.ConnectionError);
/**
* Thrown when a connection to a database has invalid values for any of the connection parameters
* @extends ConnectionError
* @constructor
*/
error.InvalidConnectionError = function (parent) {
error.InvalidConnectionError.call(this, parent);
this.name = 'SequelizeInvalidConnectionError';
};
util.inherits(error.InvalidConnectionError, error.ConnectionError);
/**
* Thrown when a connection to a database times out
* @extends ConnectionError
* @constructor
*/
error.ConnectionTimedOutError = function (parent) {
error.ConnectionTimedOutError.call(this, parent);
this.name = 'SequelizeConnectionTimedOutError';
};
util.inherits(error.ConnectionTimedOutError, error.ConnectionError);
/**
* Thrown when a database query times out because of a deadlock
* @extends DatabaseError
* @constructor
......@@ -270,3 +184,89 @@ error.ValidationErrorItem = function(message, type, path, value) {
this.path = path || null;
this.value = value || null;
};
/**
* A base class for all connection related errors.
* @extends BaseError
* @constructor
*/
error.ConnectionError = function (parent) {
error.BaseError.apply(this, [parent.message]);
this.name = 'SequelizeConnectionError';
this.parent = parent;
};
util.inherits(error.ConnectionError, error.BaseError);
/**
* The connection specific error which triggered this one
* @property parent
* @name parent
*/
error.ConnectionError.prototype.parent;
/**
* Thrown when a connection to a database is refused
* @extends ConnectionError
* @constructor
*/
error.ConnectionRefusedError = function (parent) {
error.ConnectionError.call(this, parent);
this.name = 'SequelizeConnectionRefusedError';
};
util.inherits(error.ConnectionRefusedError, error.ConnectionError);
/**
* Thrown when a connection to a database is refused due to insufficient privileges
* @extends ConnectionError
* @constructor
*/
error.AccessDeniedError = function (parent) {
error.AccessDeniedError.call(this, parent);
this.name = 'SequelizeAccessDeniedError';
};
util.inherits(error.AccessDeniedError, error.ConnectionError);
/**
* Thrown when a connection to a database has a hostname that was not found
* @extends ConnectionError
* @constructor
*/
error.HostNotFoundError = function (parent) {
error.HostNotFoundError.call(this, parent);
this.name = 'SequelizeHostNotFoundError';
};
util.inherits(error.HostNotFoundError, error.ConnectionError);
/**
* Thrown when a connection to a database has a hostname that was not reachable
* @extends ConnectionError
* @constructor
*/
error.HostNotReachableError = function (parent) {
error.HostNotReachableError.call(this, parent);
this.name = 'SequelizeHostNotReachableError';
};
util.inherits(error.HostNotReachableError, error.ConnectionError);
/**
* Thrown when a connection to a database has invalid values for any of the connection parameters
* @extends ConnectionError
* @constructor
*/
error.InvalidConnectionError = function (parent) {
error.InvalidConnectionError.call(this, parent);
this.name = 'SequelizeInvalidConnectionError';
};
util.inherits(error.InvalidConnectionError, error.ConnectionError);
/**
* Thrown when a connection to a database times out
* @extends ConnectionError
* @constructor
*/
error.ConnectionTimedOutError = function (parent) {
error.ConnectionTimedOutError.call(this, parent);
this.name = 'SequelizeConnectionTimedOutError';
};
util.inherits(error.ConnectionTimedOutError, error.ConnectionError);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!