diff --git a/docs/mithril.deferred.md b/docs/mithril.deferred.md index 4b90ea01..69120a21 100644 --- a/docs/mithril.deferred.md +++ b/docs/mithril.deferred.md @@ -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. \ No newline at end of file + 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.