UNPKG

447 BJavaScriptView Raw
1var common = require('./common');
2
3//@
4//@ ### error()
5//@ Tests if error occurred in the last command. Returns a truthy value if an
6//@ error returned and 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.
11function error() {
12 return common.state.error;
13}
14module.exports = error;