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

feat(davinci-client): normalize error details #134

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

cerebrl
Copy link
Collaborator

@cerebrl cerebrl commented Feb 25, 2025

JIRA Ticket

Jira ticket

Description

This removes the less valuable details property from the error node and replaces it with a more valuable collectors property of the error object. This isn't exactly backwards compatible, but I consider the details property on the normalized ErrorNode to be a bug. This replaces it with a way more valuable collector list of collectors that are not valid.

Copy link

changeset-bot bot commented Feb 25, 2025

🦋 Changeset detected

Latest commit: 15e8c8a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@forgerock/davinci-client Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

nx-cloud bot commented Feb 25, 2025

View your CI Pipeline Execution ↗ for commit 15e8c8a.

Command Status Duration Result
nx affected -t build typecheck lint test e2e-ci ✅ Succeeded 1m 14s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-28 00:11:27 UTC

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Deployed 72f41dd to https://ForgeRock.github.io/ping-javascript-sdk/pr-134/72f41dda92bb73043312b111cc9a757f9308cc85 branch gh-pages in ForgeRock/ping-javascript-sdk

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 58.69565% with 19 lines in your changes missing coverage. Please review.

Project coverage is 54.41%. Comparing base (bf12db7) to head (15e8c8a).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/node.slice.ts 18.18% 9 Missing ⚠️
packages/davinci-client/src/lib/node.utils.ts 80.64% 6 Missing ⚠️
packages/davinci-client/src/lib/client.store.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   46.88%   54.41%   +7.52%     
==========================================
  Files          29       21       -8     
  Lines        1284     1145     -139     
  Branches      154      160       +6     
==========================================
+ Hits          602      623      +21     
+ Misses        682      522     -160     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/davinci.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/node.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/client.store.ts 0.00% <0.00%> (ø)
packages/davinci-client/src/lib/node.utils.ts 80.64% <80.64%> (ø)
packages/davinci-client/src/lib/node.slice.ts 79.27% <18.18%> (-2.89%) ⬇️

... and 9 files with indirect coverage changes

});

return acc;
}, [] as CollectorErrors[]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe nitpicky but you can remove the as cast here

and use the generic on Reduce

return details.reduce<CollectorErrors[]>((acc, next) =>...

Copy link
Collaborator

@ryanbas21 ryanbas21 left a comment

Choose a reason for hiding this comment

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

+1 for better errors. Only one comment feel free to address if you want to, it a little nitpicky.

@cerebrl cerebrl force-pushed the feat_error-details-improvement branch from 0020da3 to 15e8c8a Compare February 28, 2025 00:09
@cerebrl cerebrl merged commit 8317e32 into main Feb 28, 2025
5 checks passed
@cerebrl cerebrl deleted the feat_error-details-improvement branch February 28, 2025 00:19
@ryanbas21 ryanbas21 mentioned this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants