Skip to content

Instantly share code, notes, and snippets.

@ageldama
Created November 16, 2018 09:26
Show Gist options
  • Select an option

  • Save ageldama/ff91266317f13beab13e25c74a2c2efb to your computer and use it in GitHub Desktop.

Select an option

Save ageldama/ff91266317f13beab13e25c74a2c2efb to your computer and use it in GitHub Desktop.
const assert = require('assert');
try {
assert(false); // no matter what
} catch(exc) {
console.log('CAUGHT=>', exc);
}
CAUGHT=> { AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(false)
at Object.<anonymous> (/home/jhyun/w/eth-fuku/est-gas/assassin.js:4:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
generatedMessage: true,
name: 'AssertionError [ERR_ASSERTION]',
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '==' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment