BlueSpire/Durandal — pull request #462 by tyrsius (2014-03-19 21:33:01+00:00)
Title: Improve error reporting for module activation

In cases where activation fails when using the Q plugin, or any other promise spec besides jQuery (which does not implement A+ properly, see [this for details](https://github.com/kriskowal/q/wiki/Coming-from-jQuery) on jQuery's promises are broken), errors are lost. I initially reported this problem [here](https://groups.google.com/forum/#!topic/durandaljs/GBO448C3ZS8).

These changes will fix this case, as well as make the errors more visible by reporting them to the console as errors and not as logs.

It appears to me that he changes to Activator were simply missed, but there may be a reason why `log()` and not `error()` was being used.

There is the possibly unwanted side effect of errors getting logged when they were in a try/catch that was properly hiding them. This solution could be improved by having Durandal end promises with `done()` so that it wasn't hiding errors in the first place. This could be done either by converting Durandal to use Q or some other library for promises throughout (a significant undertaking), or by devising a way to check for the correct `done()` and use it. I am not sure the second method can be done, because of the synchronous nature of callbacks, which are used inside the failure handlers. I don't know if either of these are desirable solutions, but if so then I wouldn't mind taking a crack at them.

Otherwise, this is will work. I definitely think it's preferable to log a couple errors that will get handled than to not log errors that won't get handled. Trying to debug why a module won't load with nothing to go on is pretty painful =(. It's also going to be a pretty rare and inadvisable case to try handling errors originating from `activator`, so its probably an edge case anyway.