Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rsvp.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
rsvp.js
Commits
6cfd108d
Commit
6cfd108d
authored
Sep 24, 2013
by
Stefan Penner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #119 from rjackson/document_onerror
Document onerror callback.
parents
c9188498
5296fefc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
README.md
README.md
+18
-0
No files found.
README.md
View file @
6cfd108d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment