Developer Resources

DbException

Overview

When exceptions are enabled, a DbException object is thrown when a database error is encountered. To enable database exceptions, which are off by default, please refer to the DbConnection.enableExceptions() method.

Methods

DbException.getError
Tests whether the connection object has an active connection to a database
DbException.getErrors
Tests whether the connection object has an active connection to a database

DbException.getError

function DbException.getError() : DbError

Returns

Returns a DbError object

Description

Returns the error object contained by the exception object. Less often an exception object may contain more than one error. In this case, the first error object is returned. To retrieve all error objects contained in the exception object, use the getErrors() method.

DbException.getErrors

function DbException.getErrors() : Array(DbError)

Returns

Returns an array of DbError object

Description

Returns all error objects contained by the DbException object