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

fix(kumascript): mention path in render error message #8936

Merged
merged 2 commits into from
May 26, 2023

Conversation

caugner
Copy link
Contributor

@caugner caugner commented May 25, 2023

Summary

Problem

When a macro fails, the console error message mentions only the macro name and the error message, making it hard to identify which page the macro failed on.

Solution

Add the document path to the error message.


Screenshots

Before

specifications macro failed: Error: /path/to/yari/kumascript/macros/Specifications.ejs:1
...

After

The specifications macro in /Users/claas/github/mdn/content/files/en-us/mdn/writing_guidelines/page_structures/page_types/aria_page_template/index.md failed to render. Error: /path/to/yari/kumascript/macros/Specifications.ejs:1
...

How did you test this change?

Ran yarn build --locale en-us in a VSCode Debug Console, setting a breakpoint in the catch block.

@caugner caugner requested review from LeoMcA and bsmth May 25, 2023 12:36
@github-actions github-actions bot added the macros tracking issues related to kumascript macros label May 25, 2023
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Thanks Claas, one comment, but it's ready either way IMO 👍🏻

Copy link
Member

@LeoMcA LeoMcA left a comment

Choose a reason for hiding this comment

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

lgtm

@caugner caugner changed the title fix(kumascript): mention page in render error message fix(kumascript): mention path in render error message May 26, 2023
@caugner caugner force-pushed the mention-page-in-macro-render-failure branch from 9ba6fff to 84b2342 Compare May 26, 2023 16:25
@caugner caugner merged commit 27938ad into main May 26, 2023
@caugner caugner deleted the mention-page-in-macro-render-failure branch May 26, 2023 16:29
fiji-flo added a commit that referenced this pull request May 27, 2023
fiji-flo added a commit that referenced this pull request May 27, 2023
fiji-flo added a commit that referenced this pull request May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros tracking issues related to kumascript macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants