AsyncMysqlException
The base exception class for any issues arising from the use of async MySQL
In general, when trying to connect to a MySQL client (e.g., via
AsyncMysqlConnectionPool::connect()
) or when making a query (e.g., via
AsyncMysqlConnection::queryf()
), it is good practice to have your code
exception catchable somewhere in the code pipeline (via
try/catch).
e.g.,
try {
// code here
} catch (AsyncMysqlException $ex) {
$error = $ex->mysqlErrorString();
}
Guides
Interface Synopsis
class AsyncMysqlException extends Exception {...}
Public Methods
->__construct(AsyncMysqlErrorResult $result)
Explicitly construct anAsyncMysqlException
->failed(): bool
Returns whether the type of failure that produced the exception was a general connection or query failure->getResult(): AsyncMysqlErrorResult
Returns the underlyingAsyncMysqlErrorResult
associated with the current exception->mysqlErrorCode(): int
Returns the MySQL error number for that caused the current exception->mysqlErrorString(): string
Returns a human-readable string for the error encountered in the current exception->timedOut(): bool
Returns whether the type of failure that produced the exception was a timeout