Global

Methods

getErrorName(errorCode) → {String}

Gets the error name with its code.
Parameters:
Name Type Description
errorCode number the error code.
Source:
Returns:
- error name.
Type
String

getKeyByValue(object, value) → {Buffer}

Gets the key of an object with its value.
Parameters:
Name Type Description
object Object the corresponding object.
value String the corresponding value.
Source:
Returns:
- object key.
Type
Buffer

getLogType(logCode) → {String}

Gets the log type name with its code.
Parameters:
Name Type Description
logCode number the log type code.
Source:
Returns:
- log type name.
Type
String

getOpName(opCode) → {String}

Gets the operation name with its code.
Parameters:
Name Type Description
opCode number the operation code.
Source:
Returns:
- operation name.
Type
String

getVersion() → {number}

Gets the actual version of the kinetic protocol.
Source:
Returns:
- the current version of the kinetic protocol.
Type
number

propError(propName, message) → {Error}

Like Error, but with a property set to true. Example: instead of: const err = new Error("input is not a buffer"); err.badTypeInput = true; throw err; use: throw propError("badTypeInput", "input is not a buffer");
Parameters:
Name Type Description
propName String the property name.
message String the Error message.
Source:
Returns:
the Error object.
Type
Error