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

Handle partial directory upload failure #8

Open
lukehedger opened this issue Aug 3, 2017 · 0 comments
Open

Handle partial directory upload failure #8

lukehedger opened this issue Aug 3, 2017 · 0 comments

Comments

@lukehedger
Copy link

When uploading a directory to http://swarm-gateways.net it is possible that the upload will only partially complete.

Taking the readme example Uploads/With JSON/Directory:

const dir = {
  "/foo.txt": {type: "text/plain", data: "file 0"},
  "/bar.txt": {type: "text/plain", data: "file 1"}
};
swarm.upload(dir).then(hash => {
  console.log("Uploaded directory. Address:", hash);
});

The console log will read:

PUT http://swarm-gateways.net/bzz:/${hash}/bar.txt 500 (Internal Server Error)

Uploaded directory. Address: error creating manifest: error loading manifest ${hash}: Manifest not Found

The first file foo.txt can then be found at http://swarm-gateways.net/bzz:/${hash}/foo.txt but bar.txt will not exist.

The fact that this error occurs is another matter but it could possibly be handled better by swarm-js with a more informative response?

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

1 participant