change Error to TypeError

node.js Buffer implementation uses TypeError https://github.com/joyent/node/blob/v0.10.29-release/lib/buffer.js#L188