Commit 50e5caea49fd5f84ce8bcacdcb8184ab7ceb0628
handle error from stat
Henry committed on 4/24/2017, 2:49:23 PMParent: 8a23233b6d6ef7855af5d5bc80121dfd89928d4b
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -174,8 +174,9 @@ | ||
174 | 174 … | )) |
175 | 175 … | |
176 | 176 … | var stream = defer.source() |
177 | 177 … | stat(toPath(dir, hash), function (err, stat) { |
178 … | + if(err) return stream.abort(err) | |
178 | 179 … | if(opts.size != null && opts.size !== stat.size) |
179 | 180 … | stream.abort(new Error('incorrect file length,' |
180 | 181 … | + ' requested:' + opts.size + ' file was:' + stat.size |
181 | 182 … | + ' for file:' + hash |
Built with git-ssb-web