Skip to content

Add error to After hook parameter #2572

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

Merged
merged 2 commits into from
Jun 11, 2025
Merged

Add error to After hook parameter #2572

merged 2 commits into from
Jun 11, 2025

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Jun 10, 2025

🤔 What's changed?

After and AfterStep hooks now contain an optional error which is the original error thrown by the step if a step failed.

⚡️ What's your motivation?

Fixes #1453.

🏷️ What kind of change is this?

  • 📖 Documentation (improvements without changing code)
  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect)
  • ⚡ New feature (non-breaking change which adds new behaviour)
  • 💥 Breaking change (incompatible changes to the API)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@coveralls
Copy link

coveralls commented Jun 10, 2025

Coverage Status

coverage: 97.742% (+0.006%) from 97.736%
when pulling e468881 on exception-in-after-hooks
into e9261dc on main.

@davidjgoss davidjgoss marked this pull request as ready for review June 10, 2025 23:59
@davidjgoss davidjgoss merged commit 44f9bbc into main Jun 11, 2025
10 checks passed
@davidjgoss davidjgoss deleted the exception-in-after-hooks branch June 11, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The exception object of an error that caused a step to fail is no longer accessible in custom formatters as of version 7
2 participants