Skip to content

fix(parameters): preserve original stack trace on transform failures … #3982

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

VatsalGoel3
Copy link
Contributor

@VatsalGoel3 VatsalGoel3 commented May 28, 2025

fix(parameters): preserve original stack trace on transform failures #3950

Summary

We were previously wrapping a thrown TransformParameterError inside a new instance, which stripped out the original stack trace pointing to transformValue.js. This PR makes sure that:

  • If a TransformParameterError is thrown, we rethrow it directly.
  • Otherwise, when we wrap a generic error in a new TransformParameterError, we copy over the original error.stack so that users see the exact call site of the failure.

Changes

  • BaseProvider.getMultiple
    • In the for (… transformValue…) loop’s catch block:
      • Rethrow existing TransformParameterError instances without wrapping.
      • When wrapping other errors, assign wrapped.stack = error.stack before throwing.

Issue number: closes #3950


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added the parameters This item relates to the Parameters Utility label May 28, 2025
@pull-request-size pull-request-size bot added the size/S PR between 10-29 LOC label May 28, 2025
@dreamorosi dreamorosi self-requested a review May 28, 2025 15:17
@github-actions github-actions bot added the bug Something isn't working label May 28, 2025
@boring-cyborg boring-cyborg bot added the tests PRs that add or change tests label May 28, 2025
@pull-request-size pull-request-size bot removed the size/S PR between 10-29 LOC label May 28, 2025
@dreamorosi dreamorosi removed their request for review May 28, 2025 16:17
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label May 28, 2025
@dreamorosi
Copy link
Contributor

Thank you @VatsalGoel3 for the PR and for fixing the issue!

@leandrodamascena, I made a commit to fix test coverage and I'd appreciate a review - the change is minimal and it'd be ok to merge from my side.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parameters This item relates to the Parameters Utility size/M PR between 30-99 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: getParameters reports incorrect stack trace when transforms fails
2 participants