UNPKG

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