Skip to content

fix: log info when UnrecoverableExceptionInterface#101

Closed
alexndlm wants to merge 1 commit intobrefphp:masterfrom
alexndlm:patch-1
Closed

fix: log info when UnrecoverableExceptionInterface#101
alexndlm wants to merge 1 commit intobrefphp:masterfrom
alexndlm:patch-1

Conversation

@alexndlm
Copy link

If the application throws UnrecoverableExceptionInterface, it is not an error.

If the application throws `UnrecoverableExceptionInterface`, it is not an error.
@mnapoli
Copy link
Member

mnapoli commented Dec 15, 2025

Why? I consider this exception to be a marker of an error that wouldn't make sense to retry, no? Are there docs about what this exception means exactly (or in which case it is used)?

@alexndlm
Copy link
Author

Yes, exactly. But the main goal for this exception is to not retry intentionaly. Related docs - https://symfony.com/doc/current/messenger.html#avoiding-retrying

@mnapoli
Copy link
Member

mnapoli commented Dec 15, 2025

I found this: https://github.com/symfony/messenger/blob/58a7efa3bebadbe4cdd8f7577c5856f0e3ea3978/EventListener/SendFailedMessageForRetryListener.php#L59-L80

In the native Messenger implementation, in case of a non-retryable exception (UnrecoverableExceptionInterface), then the error is logged as "critical" (not info as suggested in this PR).

I don't see a reason to switch the log level here, am I missing anything?

@alexndlm
Copy link
Author

Nice point. No arguments.

@alexndlm alexndlm closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants