Skip to content

Replaced exception with messageManager error message due to user error and not application error #19406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

woutersamaey
Copy link
Contributor

Replaced exception with messageManager error message due to user error and not application error

Description (*)

When subscribing to the newsletter with an existing email address, an exception is thrown, then 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.

Fixed Issues (if relevant)

Prevent the message "This email address is already subscribed." from appearing in the logs.

Manual testing scenarios (*)

  1. Subscribe an email address that already exists.
  2. You will see the error message (good), but it will also appear in the logs (unwanted)

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @woutersamaey. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@woutersamaey
Copy link
Contributor Author

Fixed a typo, squashed commits and force pushed it.

…r and not application error

Fixed typo

Added a missing space for “codacy”
@orlangur orlangur self-assigned this Nov 26, 2018
@woutersamaey woutersamaey force-pushed the replaced-exception-with-messagemanager-error-message-due-to-user-error branch from 93576d1 to 4412505 Compare November 26, 2018 11:21
@woutersamaey
Copy link
Contributor Author

woutersamaey commented Nov 26, 2018

Added an extra space for codacy + squashed and force pushed it

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@woutersamaey looks good now 👍 You fixed "}else" before I finished a comment :)

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-3565 has been created to process this Pull Request

@woutersamaey
Copy link
Contributor Author

Hurray!

@woutersamaey
Copy link
Contributor Author

Codacity does not like my else statement, but I don't really see a way around it. What's next @orlangur ?

@orlangur
Copy link
Contributor

@woutersamaey TBH, this is pretty stupid rule and Codacy may be ignored in general.

@Dharmeshvaja91
Copy link
Contributor

@woutersamaey i still able to reproduce the issue after apply your solution

@woutersamaey
Copy link
Contributor Author

woutersamaey commented Nov 27, 2018

@Dharmeshvaja91 Okay, I saw you got a handle on this in #19404. Will leave it to you then.

@Dharmeshvaja91
Copy link
Contributor

@woutersamaey Ok thank you, I will take care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants