Code cleanup: Use EnigError's vs standard Error. WIP...

This commit is contained in:
Bryan Ashby 2018-12-02 19:33:07 -07:00
parent 8f9f4227c1
commit 0c23339a2d
10 changed files with 88 additions and 77 deletions

View file

@ -1,7 +1,9 @@
/* jslint node: true */
'use strict';
let _ = require('lodash');
const { Errors } = require('./enig_error.js');
const _ = require('lodash');
// FNV-1a based on work here: https://github.com/wiedi/node-fnv
module.exports = class FNV1a {
@ -23,7 +25,7 @@ module.exports = class FNV1a {
}
if(!Buffer.isBuffer(data)) {
throw new Error('data must be String or Buffer!');
throw Errors.Invalid('data must be String or Buffer!');
}
for(let b of data) {