Class Errors
Sequelize provides a host of custom error classes, to allow you to do easier debugging. All of these errors are exposed on the sequelize object and the sequelize constructor.All sequelize errors inherit from the base JS error object.
The Base Error all Sequelize Errors inherit from.Aliases: Error
new ValidationError(message, [errors])
Validation Error. Thrown when the sequelize validation has failed. The error contains an property,which is an array with 1 or more ValidationErrorItems, one for each validation that failed.
Params:
Extends: BaseError
errors
An array of ValidationErrorItems
get(path)
Gets all validation error items for the path / field specified.
Params:
new DatabaseError()
A base class for all database related errors.
Extends: BaseError
parent
The database specific error which triggered this one
sql
The SQL that triggered the error
message()
The message from the DB.
value()
The value(s) which triggered the error
index()
The name of the index that triggered the error
new TimeoutError()
Thrown when a database query times out because of a deadlock
Extends: DatabaseError
new UniqueConstraintError()
Thrown when a unique constraint is violated in the database
Extends: DatabaseError
new ForeignKeyConstraintError()
Thrown when a foreign key constraint is violated in the database
Extends: DatabaseError
new ExclusionConstraintError()
Thrown when an exclusion constraint is violated in the database
Extends: DatabaseError
new ValidationErrorItem(message, type, path, value)
Validation Error ItemInstances of this class are included in the ValidationError.errors
property.
Params:
A base class for all connection related errors.
Extends: BaseError
parent
new ConnectionRefusedError()
Thrown when a connection to a database is refused
Extends: ConnectionError
new AccessDeniedError()
Thrown when a connection to a database is refused due to insufficient privileges
Extends: ConnectionError
new HostNotFoundError()
Thrown when a connection to a database has a hostname that was not found
Extends: ConnectionError
new HostNotReachableError()
Thrown when a connection to a database has a hostname that was not reachable
Extends: ConnectionError
new InvalidConnectionError()
Thrown when a connection to a database has invalid values for any of the connection parameters
Extends: ConnectionError
new ConnectionTimedOutError()
Thrown when a connection to a database times out
Extends: ConnectionError
Thrown when a some problem occurred with Instance methods (see message for details)
Extends: BaseError
new EmptyResultError()
Thrown when a record was not found, Usually used with rejectOnEmpty mode (see message for details)
Extends: BaseError