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

Improves YAML error handling consistency #9882

Merged
merged 2 commits into from
Jan 30, 2024
Merged

Improves YAML error handling consistency #9882

merged 2 commits into from
Jan 30, 2024

Conversation

natemoo-re
Copy link
Member

Changes

  • We have multiple places in the codebase that use slightly different YAML/Frontmatter parsing logic
  • This removes one of those instances which wasn't throwing a useful error, replacing it with a shared utility.

Testing

Tested manually with user code shared on Discord. Existing tests should pass

Docs

N/A, bug fix only

Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: 6d44fc7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 30, 2024
@lilnasy
Copy link
Contributor

lilnasy commented Jan 30, 2024

Not directly related to the current fix, but is it possible to wrap the errors in an AstroError directly in these code paths?

For #9711 as one example, the YAMLException is more helpful than the catch-all AstroError we create further down the line.

YamlException image
AstroError image

@natemoo-re
Copy link
Member Author

@lilnasy they are already wrapped with AstroError. MarkdownError is a subclass of AstroError. I think I have a solution for #9711 but I'll open a follow-up PR.

@natemoo-re natemoo-re merged commit 13c3b71 into main Jan 30, 2024
13 checks passed
@natemoo-re natemoo-re deleted the fix/yaml-errors branch January 30, 2024 23:16
@astrobot-houston astrobot-houston mentioned this pull request Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants