Skip to content

Improve error logging for recipe validation failures by including recipe name#423

Merged
timtebeek merged 2 commits intoopenrewrite:mainfrom
RaoPrashanth:main
Dec 15, 2025
Merged

Improve error logging for recipe validation failures by including recipe name#423
timtebeek merged 2 commits intoopenrewrite:mainfrom
RaoPrashanth:main

Conversation

@RaoPrashanth
Copy link
Contributor

@RaoPrashanth RaoPrashanth commented Dec 14, 2025

What's changed?

Improved error logging for recipe validation failures by including the recipe name in the error message. When recipe validation fails, the error log now shows which specific recipe caused the validation error, making it much easier to debug configuration issues.

Before:

Recipe validation error in {property}: {message}

After:

Recipe validation error in {recipeName} for property {property}: {message}

What's your motivation?

When recipe validation errors occur, the previous error messages didn't indicate which recipe was causing the problem. This made debugging difficult, especially in builds with multiple active recipes. By adding the recipe name to the error message, developers can immediately identify the problematic recipe without having to guess or step through code.

This improvement enhances the developer experience by providing clearer, more actionable error messages.

Anything in particular you'd like reviewers to focus on?

  • The error message format - does it provide enough context?
  • Whether removing the exception parameter from the log statement is appropriate (it wasn't being used in the format string anyway)

Anyone you would like to review specifically?

N/A

Have you considered any alternatives or workarounds?

Alternative considered: Including the full recipe descriptor with all options, but this would make the error message too verbose. The recipe name provides the essential context needed for debugging while keeping the message concise.

Any additional context

This is a small quality-of-life improvement that doesn't change any functionality - it only enhances the error reporting to make troubleshooting easier.

Checklist

  • I've added unit tests to cover both positive and negative cases (N/A - logging change only)
  • I've read and applied the recipe conventions and best practices (N/A - not a recipe change)
  • I've used the IntelliJ IDEA auto-formatter on affected files

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up @RaoPrashanth ! Should help others troubleshoot more effectively

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Dec 15, 2025
@timtebeek timtebeek added the enhancement New feature or request label Dec 15, 2025
@timtebeek timtebeek merged commit eafd767 into openrewrite:main Dec 15, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Log Recipe names if recipe validation error occurs

2 participants