better assert message

This commit is contained in:
Girish Ramakrishnan
2024-11-30 10:18:40 +01:00
parent 1a4a69f365
commit 1497518867

View File

@@ -10,7 +10,7 @@ exports = module.exports = BoxError;
function BoxError(reason, errorOrMessage, extra = {}) {
assert.strictEqual(typeof reason, 'string');
assert(errorOrMessage instanceof Error || typeof errorOrMessage === 'string');
assert(errorOrMessage instanceof Error || typeof errorOrMessage === 'string', `string: ${errorOrMessage} type: ${typeof errorOrMessage} json: ${JSON.stringify(errorOrMessage)}`);
assert(typeof extra === 'object');
Error.call(this);