hphp/hack/manual/apis/Classes/AsyncMysqlException/index.md
:::info[Note] This is a point-in-time snapshot of the API documentation from January 2026. Going forward, we will not be maintaining a public copy of these references, and recommend users to refer to the built-in signature helpers available in the Hack LSP instead for complete and up-to-date information. :::
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();
}
class AsyncMysqlException extends Exception {...}
->__construct(AsyncMysqlErrorResult $result)AsyncMysqlException->failed(): bool->getResult(): AsyncMysqlErrorResultAsyncMysqlErrorResult associated with the current
exception->mysqlErrorCode(): int->mysqlErrorString(): string->timedOut(): bool