Description
I want to replace the line in vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php
throw new \Magento\Framework\Exception\LocalizedException(
__('This email address is already subscribed.')
);
With:
$this->messageManager->addErrorMessage(__('This email address is already subscribed.'));
Reason is: By throwing an exception, it is later caught, added as error message + logged. Since this is a user error, it should not be logged. Our log files don't need these kinds of messages.
Changing this 1 line solves that and only that.
So, before I make a PR and get into a discussion about this. Is it something you would agree to?
Preconditions (*)
Latest Magento version
Steps to reproduce (*)
Try to subscribe an email that is already subscribed. The error log receives a message, but in my view the error log should not get this.
Expected result (*)
Show error, but don't log, it's a user issue, not a platform issue.
Actual result (*)
Error message is shown (good) + message added to log (not desired)
I am willing to make a PR, but only if this reasoning is accepted / agreed on.