Skip to content
docsv0.2.4

MysqlRepositoryException

Teaching failure of the MySQL backend: when {@see MysqlRepository} cannot reach its server it refuses to die raw. MySQL is the one backend in this package that depends on a network service, so a broken connection blocks every read and write of the store — which is exactly why each message here says what failed, why it matters, and how to fix it (start the server, switch to a zero-service backend, or repair the DSN) instead of surfacing a bare driver error. Credentials never travel in a message: a `password=` segment in the DSN is redacted before it is shown.

MysqlRepositoryException::unreachable()

public static function unreachable(string $dsn, ?Throwable $previous = null): self

MySQL did not answer at the address the DSN names — the server is down, the address is wrong, or the credentials were refused; the driver's own message rides along to say which.

Parameters

Parameters of unreachable()
NameTypeDescription
$dsnstringthe DSN exactly as the repository was constructed with; any `password=` segment is redacted before display
$previous(\Throwable | null)the original driver exception, preserved as `getPrevious()`

MysqlRepositoryException::extensionMissing()

public static function extensionMissing(): self

`ext-pdo_mysql` is not loaded, so PHP has no way to speak to a MySQL server at all.