v2.0.1: Map unknown errors to scrypt.InternalError correctly

master
Sven Slootweg 9 years ago
parent 4d96794ab9
commit 697e18dd2b

@ -44,7 +44,7 @@ scryptHandler = (resolve, reject) ->
# Well, `scrypt` now returns real Error objects. Except now they don't have error codes anymore...
return (err, result) ->
if err?
errorObj = switch scryptErrorMap[err.message]
errorObj = switch (scryptErrorMap[err.message] ? -1)
when 1, 2, 3, 4, 5, 6, 9, 10, 12, 13, -1 then errors.ScryptInternalError
when 7, 8 then errors.ScryptInputError
when 11 then errors.ScryptPasswordError

@ -65,7 +65,8 @@ scryptHandler = function(resolve, reject) {
var errorObj;
if (err != null) {
errorObj = (function() {
switch (scryptErrorMap[err.message]) {
var _ref;
switch ((_ref = scryptErrorMap[err.message]) != null ? _ref : -1) {
case 1:
case 2:
case 3:

@ -1,6 +1,6 @@
{
"name": "scrypt-for-humans",
"version": "2.0.0",
"version": "2.0.1",
"description": "A human-friendly API wrapper for the Node.js Scrypt bindings.",
"main": "index.js",
"scripts": {

Loading…
Cancel
Save