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(images): Improve error handling around the new assets feature #6649

Merged
merged 18 commits into from
Mar 29, 2023

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Mar 24, 2023

Changes

This adds some more error handling around recently revamped features, notably Markdown (both frontmatter and content) will now error properly when images are not found.

This PR also does a very small logic fix to images in the frontmatter where images would sometimes be resolved from the wrong collection.

Testing

Added tests

Docs

cc @withastro/maintainers-docs ! Some new errors to look at in the classic errors-data

@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2023

🦋 Changeset detected

Latest commit: 8a1e64e

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 Mar 24, 2023
},
schema,
{ description: undefined }
{ description: '__image' }
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated bug fix. Since we resetted the description, the paths would always be relative to the first collection loaded instead of the one currently being rendered

@Princesseuh Princesseuh marked this pull request as ready for review March 27, 2023 16:37
@Princesseuh Princesseuh requested a review from a team as a code owner March 27, 2023 16:37
Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

Good job @Princesseuh, added a few suggestions 🙌

packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
@Princesseuh Princesseuh marked this pull request as draft March 28, 2023 11:50
@Princesseuh
Copy link
Member Author

Investigating a Windows thing... Not too sure of the cause.

@Princesseuh Princesseuh marked this pull request as ready for review March 28, 2023 13:05
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

I am loving all these error message PRs! 🥳

Thanks, @Princesseuh for being such a champion of these! I made some non-blocking suggestions for you, to use as you see fit!

packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
@Princesseuh Princesseuh merged commit f0b732d into main Mar 29, 2023
@Princesseuh Princesseuh deleted the fix/images-errors branch March 29, 2023 12:58
@astrobot-houston astrobot-houston mentioned this pull request Mar 29, 2023
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.

4 participants