v12.0.0 - initial commit

This commit is contained in:
padreug 2025-12-31 19:04:13 +01:00
commit e2c49ea43c
1145 changed files with 97211 additions and 0 deletions

View file

@ -0,0 +1,27 @@
const _ = require('lodash/fp')
const E = function (name) {
var CustomErr = function (msg) {
this.message = msg || _.startCase(name)
this.name = name
Error.captureStackTrace(this, CustomErr)
}
CustomErr.prototype = Object.create(Error.prototype)
CustomErr.prototype.constructor = CustomErr
CustomErr.code = name
return CustomErr
}
module.exports = E
function register(errorName) {
E[errorName] = E(errorName)
}
register('BadNumberError')
register('NoDataError')
register('InsufficientFundsError')
register('StaleTxError')
register('RatchetError')
register('NotImplementedError')