Back to Hhvm

AsyncMysqlException

hphp/hack/manual/apis/Classes/AsyncMysqlException/index.md

latest2.2 KB
Original Source

:::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();
}

Guides

Interface Synopsis

Hack
class AsyncMysqlException extends Exception {...}

Public Methods

<!-- HHAPIDOC -->