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

Don't throw runtime error on missing assets #544

Merged
merged 3 commits into from
Feb 9, 2025

Conversation

dgvirtual
Copy link
Collaborator

@dgvirtual dgvirtual commented Feb 5, 2025

Missing assets currently terminate page execution in runtime exception. Since asset is external file, it being missing should not be the cause of breaking the page itself.

With these changes, when a missing asset is encountered, a string with a missing asset notice is produced, like:
https://example.com/assets/admin/js/tinymce6-ru~~asset-is-missing.js

This PR closes issue #538

@dgvirtual
Copy link
Collaborator Author

dgvirtual commented Feb 5, 2025

@neznaika0, apparently this behavior was expected (as the test I had to change indicates). But our case, where asset name might depend on some dynamic variable, shows that it might not be the best expectation.

Anyway, we have to ask @lonnieezell if we can proceed with this change.

@dgvirtual dgvirtual requested a review from lonnieezell February 5, 2025 20:23
Copy link
Owner

@lonnieezell lonnieezell left a comment

Choose a reason for hiding this comment

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

My typical stance is that a developer should know what they're including into the site and it should break fast to let the developer know. That's why this was coded that way.

However, I have no problem with this change.

Looks good.

@dgvirtual dgvirtual merged commit ddaa3d0 into lonnieezell:develop Feb 9, 2025
6 checks passed
@dgvirtual
Copy link
Collaborator Author

@lonnieezell, thanks for review. To compensate for not breaking early I have added a log message - warning - on missing asset.

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