Exception
extends Exception
in package
Database exception
Thrown by Nextcloud's database abstraction layer. This is the base class that any specific exception will extend. Use this class in your try-catch to catch any error related to the database. Use any of the subclasses in the same namespace if you are only interested in specific errors.
Tags
Table of Contents
- REASON_CONNECTION_LOST = 1
- Nextcloud lost connection to the database
- REASON_CONSTRAINT_VIOLATION = 2
- A database constraint was violated
- REASON_DATABASE_OBJECT_EXISTS = 3
- A database object (table, column, index) already exists
- REASON_DATABASE_OBJECT_NOT_FOUND = 4
- A database object (table, column, index) can't be found
- REASON_DEADLOCK = 5
- The database ran into a deadlock
- REASON_DRIVER = 6
- The database driver encountered an issue
- REASON_FOREIGN_KEY_VIOLATION = 7
- A foreign key constraint was violated
- REASON_INVALID_ARGUMENT = 8
- An invalid argument was passed to the database abstraction
- REASON_INVALID_FIELD_NAME = 9
- A field name was invalid
- REASON_NON_UNIQUE_FIELD_NAME = 10
- A name in the query was ambiguous
- REASON_NOT_NULL_CONSTRAINT_VIOLATION = 11
- A not null constraint was violated
- REASON_SERVER = 12
- A generic server error was encountered
- REASON_SYNTAX_ERROR = 13
- A syntax error was reported by the server
- REASON_UNIQUE_CONSTRAINT_VIOLATION = 14
- A unique constraint was violated
- getReason() : int|null
Constants
REASON_CONNECTION_LOST
Nextcloud lost connection to the database
public
mixed
REASON_CONNECTION_LOST
= 1
Tags
REASON_CONSTRAINT_VIOLATION
A database constraint was violated
public
mixed
REASON_CONSTRAINT_VIOLATION
= 2
Tags
REASON_DATABASE_OBJECT_EXISTS
A database object (table, column, index) already exists
public
mixed
REASON_DATABASE_OBJECT_EXISTS
= 3
Tags
REASON_DATABASE_OBJECT_NOT_FOUND
A database object (table, column, index) can't be found
public
mixed
REASON_DATABASE_OBJECT_NOT_FOUND
= 4
Tags
REASON_DEADLOCK
The database ran into a deadlock
public
mixed
REASON_DEADLOCK
= 5
Tags
REASON_DRIVER
The database driver encountered an issue
public
mixed
REASON_DRIVER
= 6
Tags
REASON_FOREIGN_KEY_VIOLATION
A foreign key constraint was violated
public
mixed
REASON_FOREIGN_KEY_VIOLATION
= 7
Tags
REASON_INVALID_ARGUMENT
An invalid argument was passed to the database abstraction
public
mixed
REASON_INVALID_ARGUMENT
= 8
Tags
REASON_INVALID_FIELD_NAME
A field name was invalid
public
mixed
REASON_INVALID_FIELD_NAME
= 9
Tags
REASON_NON_UNIQUE_FIELD_NAME
A name in the query was ambiguous
public
mixed
REASON_NON_UNIQUE_FIELD_NAME
= 10
Tags
REASON_NOT_NULL_CONSTRAINT_VIOLATION
A not null constraint was violated
public
mixed
REASON_NOT_NULL_CONSTRAINT_VIOLATION
= 11
Tags
REASON_SERVER
A generic server error was encountered
public
mixed
REASON_SERVER
= 12
Tags
REASON_SYNTAX_ERROR
A syntax error was reported by the server
public
mixed
REASON_SYNTAX_ERROR
= 13
Tags
REASON_UNIQUE_CONSTRAINT_VIOLATION
A unique constraint was violated
public
mixed
REASON_UNIQUE_CONSTRAINT_VIOLATION
= 14
Tags
Methods
getReason()
public
getReason() : int|null