guardian/frontend — pull request #7047 by rich-nguyen (2014-11-10 18:44:54+00:00)
Title: Handle media errors

Our raven bootstrap context, the existing context we use during application init, does not catch errors in async require modules. Errors that are thrown in async require modules will actually bubble up to their respective script tag parent, thanks to curl.

The only way to catch this class of error is by wrapping on one side of the app-module call. It's typically easier to wrap things on the app side, like we do here, with the caveat that any module init errors are not within the wrap (that still gets caught in the bootstrap context).