Commit 6cfd108d authored by Stefan Penner's avatar Stefan Penner

Merge pull request #119 from rjackson/document_onerror

Document onerror callback.
parents c9188498 5296fefc
......@@ -147,6 +147,24 @@ getJSON("/post/1.json").then(function(post) {
});
```
## Error Handling
There are times when dealing with promises that it seems like any errors
are being 'swallowed', and not properly raised. This makes is extremely
difficult to track down where a given issue is coming from. Thankfully,
`RSVP` has a solution for this problem built in.
You can provide an `onerror` function that will be called with the error
details if any errors occur within your promise. This function can be anything
but a common practice is to call `console.assert` to dump the error to the
console.
```javascript
RSVP.configure('onerror', function(error) {
console.assert(false, error);
});
```
## Arrays of promises
Sometimes you might want to work with many promises at once. If you
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment