[PR #1484] Make exception message configurable for NoResultException #9541

Closed
opened 2026-01-22 16:04:37 +01:00 by admin · 0 comments
Owner

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.

**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.
admin added the pull-request label 2026-01-22 16:04:37 +01:00
admin closed this issue 2026-01-22 16:04:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9541