mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #1484] Make exception message configurable for NoResultException #9541
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/1484
State: closed
Merged: No
Currently it's not possible to use a custom exception message for the NoResultException. It would be great to use a custom one. For example you can define what specific result was expected or with what query it was executed, let's say you want to find members with a select query. Then it would be great if the message could be 'No members found for query.', instead of the default message.
This change is backward compatible, because it uses the current message as default value for message. Furthermore it's now possible to loop the parameters $code and $prevision exception throw this NoResultException.
Thanks for the hint Koc.