Error «no connection to server» is detected as Intergrity exception
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 216
- Forks
- 51
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 2
Description
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.
Package version
2.0
PHP version
8.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/Exception/ConvertException.php around lines 19–21 and inspect how the MySQL error SQLSTATE[HY000]: General error: 7 no connection to the server is classified. Reproduce the lost-connection case and verify that it no longer becomes an IntegrityException, using the most appropriate existing exception type or confirming whether a new connection-specific type is needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100