ethereum / swarm-dapps

Swarm Đapp Examples
98 stars 202 forks source link

Missing error handling on json directory upload #18

Open nagydani opened 6 years ago

nagydani commented 6 years ago

The function body at https://github.com/ethereum/swarm-dapps/blob/master/examples/album/file-manager.js#L104 does not handle errors and assigns i with the http response even if the status is different from 200 and the response is not a hash. A sanity check similar to https://github.com/ethereum/swarm-dapps/blob/master/examples/album/file-manager.js#L22 would probably do the trick. In fact, it would be nice to have a common code for PUT-ting a file and then receiving and checking a hash.