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

Missing resources #1136

Open
rustyconover opened this issue Jan 16, 2021 · 1 comment
Open

Missing resources #1136

rustyconover opened this issue Jan 16, 2021 · 1 comment

Comments

@rustyconover
Copy link
Contributor

Hi AssetGraph experts,

It seems that building an AssetGraph fails if some of the resources can't be loaded. The exceptions just bubble up.

I have a use case where building a graph even when there are missing resources. If I'm using AssetGraph to archive a collection of linked assets, it may be perfectly acceptable to have 404 errors for assets, it may be useful to be able to default an asset's content in the case of 404 or some other error when retrieving the asset.

Would you be interested in a pull request for this new behavior?

Rusty

@papandreou
Copy link
Member

Hey Rusty! I'm guessing that you're running into some warnings that get "promoted" to errors here because you don't have a listener for the warn event:

if (this.listeners('warn').length > 0) {
this.emit('warn', err);

Does adding assetGraphInstance.on('warn', err => { /* ... */ }); do what you need?

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

No branches or pull requests

2 participants