error.js 451 B

123456789101112131415
  1. var common = require('./common');
  2. //@
  3. //@ ### error()
  4. //@
  5. //@ Tests if error occurred in the last command. Returns a truthy value if an
  6. //@ error returned, or a falsy value otherwise.
  7. //@
  8. //@ **Note**: do not rely on the
  9. //@ return value to be an error message. If you need the last error message, use
  10. //@ the `.stderr` attribute from the last command's return value instead.
  11. function error() {
  12. return common.state.error;
  13. }
  14. module.exports = error;