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

nasty error message #15

Closed
maxogden opened this Issue Jan 5, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@maxogden
Collaborator

maxogden commented Jan 5, 2016

calling this https://github.com/maxogden/dat/blob/c29fe52378fcdd025c6b664f6fc371b0592e2a6b/index.js#L128

on an entry that has no data (in this case it is a folder that was added as a type: file) causes this error stack:

buffer.js:572
        return this.utf8Write(string, offset, length);
                    ^

TypeError: Argument must be a string
    at TypeError (native)
    at Buffer.write (buffer.js:572:21)
    at Object.exports.bytes.encode (/Users/max/src/js/dat/node_modules/hyperdrive/node_modules/protocol-buffers/encodings.js:35:17)
    at Object.encode (eval at <anonymous> (/Users/max/src/js/dat/node_modules/hyperdrive/node_modules/protocol-buffers/node_modules/generate-function/index.js:55:21), <anonymous>:13:10)
    at Protocol._push (/Users/max/src/js/dat/node_modules/hyperdrive/lib/protocol.js:290:7)
    at Protocol.join (/Users/max/src/js/dat/node_modules/hyperdrive/lib/protocol.js:302:8)
    at Swarm.join (/Users/max/src/js/dat/node_modules/hyperdrive/lib/swarm.js:135:19)
    at new Feed (/Users/max/src/js/dat/node_modules/hyperdrive/lib/feed.js:24:37)
    at Feed (/Users/max/src/js/dat/node_modules/hyperdrive/lib/feed.js:11:39)
    at Hyperdrive.get (/Users/max/src/js/dat/node_modules/hyperdrive/index.js:42:10)

would be nice to have a more user friendly error here

@karissa karissa closed this Mar 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment