Skip to content

WebLoader does not try next source if request returns a 404 response #31

@mraerino

Description

@mraerino

Expected Behavior

If an asset request returns a 404 response the WebLoader should skip that source and try the next.

Actual Behavior

The 404 response body is returned.

Steps to Reproduce

class Storage extends ScratchStorage {
    constructor () {
        super();
        this.addWebSource(
            [this.AssetType.Project],
            asset => `https://example.com/${asset.assetId}`
        );
    }
}

const storage = new Storage();
storage.load(storage.AssetType.Project, "x", storage.DataFormat.JSON)
    .then(project => console.log("I did load this:", project))
    .catch(e => console.error("Loading failed"));

I'll try to submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions