Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Oct 21, 2015
1 parent 0b127f8 commit b1b357e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ letta(function () {
```

### Errors
> You should **notice** that if some function **returns** instance of `Error` it will acts like error is thrown from that function.
> You should **notice** that if some function **returns** instance of `Error` it will acts as normal value. You will receive it in `.then` not in `.catch` as you may expect. See and run `examples/errors.js` example.
**Example**

Expand All @@ -231,8 +231,9 @@ const letta = require('letta')
letta(function () {
return new Error('foo err bar')
})
.catch(err => {
console.log(err.message) // => 'foo err bar'
.then(res => {
console.log(res instanceof Error) // => true
console.log(res.message) // => 'foo err bar'
})
```

Expand Down Expand Up @@ -313,7 +314,7 @@ letta(function * () {
Just like arrays, objects resolve all `yieldable`s in parallel.

```js
letta(function* () {
letta(function * () {
var res = yield {
1: Promise.resolve(1),
2: Promise.resolve(2),
Expand Down

0 comments on commit b1b357e

Please sign in to comment.