Skip to content
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

refactor: reduce duplication in the error-collector #2323

Merged
merged 8 commits into from
Jul 2, 2024

Conversation

amychisholm03
Copy link
Contributor

@amychisholm03 amychisholm03 commented Jul 1, 2024

  • Refactored _processUserErrors, _processTransactionExceptions, and _processTransactionErrors into a single function: _processErrors

Original Ticket:

  • There's a lot of duplication here--for example, in the error-collector, _processUserErrors and _processTransactionExceptions are nearly identical, apart from the property they inspect. _processTransactionErrors behaves only slightly differently. Those three could be collapsed into one processor.
  • First half of this Jira ticket (https://new-relic.atlassian.net/browse/NR-96722)

Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

Looks good. I have some feedback on JSDoc formatting, and a couple items for consideration, but this is very close to ready.

lib/errors/error-collector.js Outdated Show resolved Hide resolved
lib/errors/error-collector.js Outdated Show resolved Hide resolved
lib/errors/error-collector.js Outdated Show resolved Hide resolved
lib/errors/error-collector.js Outdated Show resolved Hide resolved
lib/errors/error-collector.js Outdated Show resolved Hide resolved
lib/errors/error-collector.js Show resolved Hide resolved
Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

We're really close. I believe that addressing these comments will finish it off.

test/unit/errors/error-collector.test.js Outdated Show resolved Hide resolved
test/unit/errors/error-collector.test.js Outdated Show resolved Hide resolved
test/unit/errors/error-collector.test.js Outdated Show resolved Hide resolved
test/unit/errors/error-collector.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

Fantastic! Looks good.

@amychisholm03 amychisholm03 merged commit 10581bf into newrelic:main Jul 2, 2024
32 checks passed
@amychisholm03 amychisholm03 deleted the error-collector branch July 2, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants