tildeio/router.js — pull request #42 by raycohen (2013-07-27 21:08:56+00:00)
Title: remove duplicated `handleError`s from the model validation promise chain

Both `transaction.abort()`, by way of the `handleAbort` method, and any errors thrown, or explicit `RSVP.reject`s returned, will make their way to the `handleError` catch at the end of the chain.

It is possible for (before/after)`model` to call `transaction.abort()` and **also** throw an error. In this case, by the time we reach `handleError`, `transaction.isAborted === true`, but we still want to trigger the `error` handler. To do so we check the `reason` explicitly to see if it is a `Router.TransitionAborted`.