Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #35993 Remove int return type from FlattenException::getCode (wuc…
…dbm) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Remove int return type from FlattenException::getCode | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | - <!-- required for new features --> Heya, So my project died with `Return value of Symfony\Component\ErrorHandler\Exception\FlattenException::getCode() must be of the type int, string returned` symfony error page. Quite unexpected. Turns out it's a `Doctrine\DBAL\Driver\PDOException` with code `42S02` and message `SQLSTATE[42S02]: Base table or view not found: 1146 Table 'some_db.some_table' doesn't exist`. This is because I use the `FlattenException` class to serialize errors and store elsewhere, just more convenient to quickly check for any errors. I guess noone has stumbled upon a PDOException / `FlattenException::getCode` before. https://www.php.net/manual/en/throwable.getcode.php `Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).` Commits ------- 0f22e07 Remove int return type from FlattenException::getCode
- Loading branch information