Small change to example code

This commit is contained in:
Liam Curry 2015-02-01 00:59:46 -07:00
parent eb3885ea5e
commit 0cd1c4e5bf

View file

@ -163,7 +163,7 @@ The other side of the coin is still supported: if a developer needs to signal an
var error = m.prop()
m.request({method: "GET", url: "/user/:id", data: {id: 1}})
.then(function(user) {
if (user.isAdmin) throw new Error("Sorry, you don't have permissions")
if (!user.isAdmin) throw new Error("Sorry, you don't have permissions")
})
.then(null, error) //handle the application error: bind to a getter-setter for diplaying it on the template
```
@ -249,4 +249,4 @@ where:
**void onerror(Error e)**
This method gets called every time an exception is thrown inside a promise callback. By default, it rethrows to the console if an error is a subclass of Error (but not an instance of Error itself). Otherwise it follows the Promises/A+ specifications.
This method gets called every time an exception is thrown inside a promise callback. By default, it rethrows to the console if an error is a subclass of Error (but not an instance of Error itself). Otherwise it follows the Promises/A+ specifications.