Merge pull request #438 from liamcurry/patch-1
Small change to example code
This commit is contained in:
commit
ffd7efc15d
1 changed files with 2 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue