fix: allow asset url function to indicate skipping #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves
Is connected to #31 but I did not create an issue for this particular change.
Proposed Changes
Whenever an
assetUrlreturnsfalsetheWebHelpertries the next source.Reason for Changes
If there are multiple web sources, the url function may want to indicate whether the current asset is available in its source, based on the asset. While sources are already filtered by asset type, there may be different properties that determine if a source is applicable.
In our case, we use a special prefix on some projects to indicate a special source (like a special S3 location). The source will always be the first source, so we can be sure the prefixed projects are always loaded from the right source. But if the prefix is missing the url function should be able to indicate a skip by returning false. Throwing an error is not handled and results in a failure of the app.
Test Coverage
Will add, if wanted.