From 6c42969d01e855cc7959f14e0782e8dbf4fc0718 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Tue, 16 Sep 2014 11:44:51 -0700 Subject: [PATCH] improve error message --- lib/ecdsa.js | 2 +- test/ecdsa.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ecdsa.js b/lib/ecdsa.js index f33ea51..ddb4af6 100644 --- a/lib/ecdsa.js +++ b/lib/ecdsa.js @@ -114,7 +114,7 @@ ECDSA.prototype.sig2pubkey = function() { ECDSA.prototype.sigError = function() { if (!Buffer.isBuffer(this.hashbuf) || this.hashbuf.length !== 32) - return 'Invalid hash'; + return 'hashbuf must be a 32 byte buffer'; try { this.keypair.pubkey.validate(); diff --git a/test/ecdsa.js b/test/ecdsa.js index bf04979..5de755e 100644 --- a/test/ecdsa.js +++ b/test/ecdsa.js @@ -105,7 +105,7 @@ describe("ECDSA", function() { it('should return an error if the hash is invalid', function() { var ecdsa = new ECDSA(); - ecdsa.sigError().should.equal('Invalid hash'); + ecdsa.sigError().should.equal('hashbuf must be a 32 byte buffer'); }); it('should return an error if the pubkey is invalid', function() {