Animatron/player — pull request #65 by shamansir (2012-12-28 17:56:21+00:00)
Title: Improved errors handling

Now errors are always reported independently of the place they were fired during the animation.

There are three types of errors for now:

* `SystemError`: an error related neither to animation nor to player, but thrown from player code i.e. incorrect AJAX call using utils
* `PlayerError`: an error related to initializing or manipulating player
* `AnimationError`: an error related to the animation process

It is possible to assign an `onerror` handler to a player, it will catch all of the errors happening inside of the given instance of player. If handler returns `true`, error will be suppressed from firing, if it returns nothing or `false`, error will be fired as in normal situation.

player.onerror(function(err) { console.log('catched', err); console.error(err); return true; });

There is also a player option `muteErrors`, which is `false` by default and if it is `true`, it will mute all of the errors except system ones. its logic is tested in this Pull Request, but specifying though options or canvas it will be tested separately.