Skip to content

Commit

Permalink
Document ability to fail task with custom callback (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobek authored and sindresorhus committed May 15, 2016
1 parent b3cd4b4 commit 54e6c03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ Do whatever you want with the output.

```js
function log(err, stdout, stderr, cb) {
if (err) {
cb(err);
return;
}

console.log(stdout);
cb();
}
Expand Down Expand Up @@ -221,7 +226,7 @@ Type: `Function`

Lets you override the default callback with your own.

**Make sure to call the `cb` method when you're done.**
**Make sure to call the `cb` method when you're done.** Supply an error as the first argument to `cb` to print a warning and cause the task to fail.

### preferLocal

Expand Down

0 comments on commit 54e6c03

Please sign in to comment.