Nextcloud PHP API (master)

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
psalm-immutable
since
21.0.0

Table of Contents

Constants

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

Methods

getReason()  : int|null

Constants

REASON_CONNECTION_LOST

Nextcloud lost connection to the database

public mixed REASON_CONNECTION_LOST = 1
Tags
since
21.0.0

REASON_CONSTRAINT_VIOLATION

A database constraint was violated

public mixed REASON_CONSTRAINT_VIOLATION = 2
Tags
since
21.0.0

REASON_DATABASE_OBJECT_EXISTS

A database object (table, column, index) already exists

public mixed REASON_DATABASE_OBJECT_EXISTS = 3
Tags
since
21.0.0

REASON_DATABASE_OBJECT_NOT_FOUND

A database object (table, column, index) can't be found

public mixed REASON_DATABASE_OBJECT_NOT_FOUND = 4
Tags
since
21.0.0

REASON_DEADLOCK

The database ran into a deadlock

public mixed REASON_DEADLOCK = 5
Tags
since
21.0.0

REASON_DRIVER

The database driver encountered an issue

public mixed REASON_DRIVER = 6
Tags
since
21.0.0

REASON_FOREIGN_KEY_VIOLATION

A foreign key constraint was violated

public mixed REASON_FOREIGN_KEY_VIOLATION = 7
Tags
since
21.0.0

REASON_INVALID_ARGUMENT

An invalid argument was passed to the database abstraction

public mixed REASON_INVALID_ARGUMENT = 8
Tags
since
21.0.0

REASON_INVALID_FIELD_NAME

A field name was invalid

public mixed REASON_INVALID_FIELD_NAME = 9
Tags
since
21.0.0

REASON_NON_UNIQUE_FIELD_NAME

A name in the query was ambiguous

public mixed REASON_NON_UNIQUE_FIELD_NAME = 10
Tags
since
21.0.0

REASON_NOT_NULL_CONSTRAINT_VIOLATION

A not null constraint was violated

public mixed REASON_NOT_NULL_CONSTRAINT_VIOLATION = 11
Tags
since
21.0.0

REASON_SERVER

A generic server error was encountered

public mixed REASON_SERVER = 12
Tags
since
21.0.0

REASON_SYNTAX_ERROR

A syntax error was reported by the server

public mixed REASON_SYNTAX_ERROR = 13
Tags
since
21.0.0

REASON_UNIQUE_CONSTRAINT_VIOLATION

A unique constraint was violated

public mixed REASON_UNIQUE_CONSTRAINT_VIOLATION = 14
Tags
since
21.0.0

Methods

getReason()

public getReason() : int|null
Tags
psalm-return

Exception::REASON_*

since
21.0.0
Return values
int|null

        
On this page

Search results