Consensys / truffle-security

MythX smart contract security verification plugin for Truffle Framework
https://mythx.io
124 stars 28 forks source link

Missing password and ethAddress should not show traceback #72

Closed nbanmp closed 5 years ago

nbanmp commented 5 years ago

A relatively common issue might be setting MYTHX_ETH_ADDRESS, but not MYTHX_PASSWORD, or vice versa. We currently error and display a complete traceback that does contain enough information to determine the issue, but a concise and clear error message and graceful exit is more appropriate.

━━┫unset MYTHX_ETH_ADDRESS
━━┫truffle run verify --timeout 100
TypeError: Please provide an Ethereum address and a password.
    at new Client (/home/nat/Dev/truffle-security/truffle-security/node_modules/armlet/index.js:34:13)
    at getArmletClient (/home/nat/Dev/truffle-security/truffle-security/helpers.js:383:12)
    at Object.analyze (/home/nat/Dev/truffle-security/truffle-security/helpers.js:402:20)
    at module.exports (/home/nat/Dev/truffle-security/truffle-security/index.js:27:26)
    at Object.run (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/run.js:59:1)
    at Object.run (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/commands/run.js:30:1)
    at Command.run (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/command.js:113:1)
    at Object.<anonymous> (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/packages/truffle-core/cli.js:54:1)
    at __webpack_require__ (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/webpack/bootstrap 69e30829cd47ee94a967:19:1)
    at /home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/webpack:/webpack/bootstrap 69e30829cd47ee94a967:65:1
    at Object.<anonymous> (/home/nat/.nvm/versions/node/v11.10.0/lib/node_modules/truffle/build/cli.bundled.js:71:10)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
    at internal/main/run_main_module.js:21:11
Truffle v5.0.4 (core: 5.0.4)
Node v11.10.0
rocky commented 5 years ago

Thanks! @daniyarchambylov would you please fix. (Actually, the fix I believe is in armlet. Daniyar would know.)