Skip to content

Test invalid importmap file #101

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
Jan 27, 2022
Merged

Conversation

AndyStabler
Copy link
Contributor

This PR adds a test to cover an invalid importmap file and makes use of a custom error class for easier error tracking.

While I was in there I noticed we're rescuing Exceptions rather than StandardErrors when parsing importmap files. That's interesting to me as it's usually something I avoid doing—Exceptions are raised by events like a system interrupt, which I imagine we wouldn't want to swallow. I'm happy to remove that commit if it's required though 😄

Raising a custom error means it's a bit easier to track across error
monitoring tools.
We usually don't want to rescue the base Exception class as these errors
are reserved for things like a system interrupt. This commit swaps that out
for rescuing a StandardErrorr.
@dhh dhh merged commit ef8dc82 into rails:main Jan 27, 2022
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.

2 participants