Enhancement: use internal exception
Open
Scheduled for V2
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
This library is currently throwing a generic `RuntimeException` when the pdf conversion fails, see the source code at https://github.com/KnpLabs/snappy/blob/master/src/Knp/Snappy/AbstractGenerator.php#L431
This makes it hard for the users to properly react to such exceptions since they are forced to rely on the exception text message (which it's not even guaranteed to stay the same).
So, a possible nice enhancement could be adding an internal exception (extending `RuntimeException`, so it would be back-compatible)
By the way, this library already uses this approach with `Knp\Snappy\Exception\FileAlreadyExistsException`
I can provide a PR.
Contributor guide
Assessment
This issue has not been assessed yet.