Skip to content

Error «no connection to server» is detected as Intergrity exception #1169

@batyrmastyr

Description

@batyrmastyr

Description

When connection to MySQL server is lost you get

Yiisoft\Db\Exception\IntegrityException: SQLSTATE[HY000]: General error: 7 no connection to the server

instead of more correct Yiisoft\Db\Exception\Exception or, maybe, more specific, but not existing ConnectionException.

Source:

private const MSG_INTEGRITY_EXCEPTION_1 = 'SQLSTATE[23';
private const MGS_INTEGRITY_EXCEPTION_2 = 'ORA-00001: unique constraint';
private const MSG_INTEGRITY_EXCEPTION_3 = 'SQLSTATE[HY';

Package version

2.0

PHP version

8.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions