DML exceptions
Newer Version Available
This documentation is for Moodle 4.5.
You may also want to read the documentation for the upcoming version of Moodle.
You may also want to read the documentation for the upcoming version of Moodle.
The DML API uses a selection of exceptions to indicate errors.
Types of exception
dml_connection_exception
Thrown when can not connect to database for any reason.
dml_read_exception
Problem occurred during reading from database. Originally indicated be returning false - this value was often confused with false return value meaning not found.
dml_write_exception
Problem occurred during writing to database. Originally indicated be returning false.
See also
- Exceptions: General guidelines for using of exceptions in Moodle 2.0
- DML functions: Where all the functions used to handle DB data. (DML) are defined.
- DDL functions: Where all the functions used to handle DB objects (DDL) are defined.