Skip to content

Conversation

MEPalma
Copy link
Contributor

@MEPalma MEPalma commented Jan 2, 2025

Motivation

Errors occurring during JSONPath operations are currently not reported accurately #11951. Additionally, error messages lack consistency across different JSONPath operations, such as those involving JSON templates and fields like InputPath, OutputPath, HeartbeatSecondsPath, etc.. Assembling these error messages is non-trivial, as it requires including the relevant field name. This update introduces logic to enhance the clarity and consistency of these error messages, as well as adding tests. A limitation of these changes are the execution history produced in the case of errors with TimeoutSecondsPath and HeartbeatSecondsPath, as these appear to be computed at a state level. However, the error messages are still corrcetly formatted and reported.

Changes

  • jsonpath extraction logic is revised to raise a NoSuchJsonPathError exception which is reported in the absence of refined formatting logics
  • the environment now keeps track of the field names being evaluated, which can be sampled by other logics to compose error messages
  • EvalComponent objects now update the field they are evaluating in the environment
  • Fields with custom error reporting logic implement their custom behaviour
  • Default error reports for NoSuchJsonPathError
  • minor change to next_state_name to ensure the reference to the program state instance being manipulated is not lost between it's validation and the action call

@MEPalma MEPalma added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Jan 2, 2025
@MEPalma MEPalma added this to the 4.1 milestone Jan 2, 2025
@MEPalma MEPalma self-assigned this Jan 2, 2025
@MEPalma MEPalma changed the title StepFunctions: Better Error Messages For JSONPath operations StepFunctions: Better Error Messages For JSONPath Operations Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 51m 24s ⏱️ - 1m 43s
3 927 tests +8  3 618 ✅ +6  309 💤 +2  0 ❌ ±0 
3 929 runs  +8  3 618 ✅ +6  311 💤 +2  0 ❌ ±0 

Results for commit db33c9d. ± Comparison against base commit 3e1471a.

Copy link
Contributor

@gregfurman gregfurman left a comment

Choose a reason for hiding this comment

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

LGTM!

Noticed you didn't mention the next_state changes in the PR description. Any chance you can briefly add something on it? Diff look fine but just want to make sure we're aligned 🙂

@MEPalma MEPalma merged commit 0191993 into master Jan 8, 2025
33 checks passed
@MEPalma MEPalma deleted the MEP-sfn-path_error branch January 8, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants