code: function captureObjectErrors(object, objectName) {
  
  		var propertyName,
  			propertyValue;
  
  		/* eslint-disable guard-for-in, no-loop-func */
  		for (propertyName in object) {
  			propertyValue = object[propertyName];
  
  			// only do this for methods, be sure to check before making changes!
  			if (typeof propertyValue === 'function') {
  				/*
  				 * This creates a new function that wraps the original function
  				 * in a try-catch. The outer function executes immediately with
  				 * the name and actual method passed in as values. This allows
  				 * us to create a function with specific information even though
  				 * it's inside of a loop.
  				 */
  				object[propertyName] = (function(methodName, method) {
  					return function() {
  						try {
  							return method.apply(this, arguments);
  						} catch (ex) {
  							ex.name = objectName + '.' + methodName + '() - ' + ex.name;
  							error(ex);
  						}
  					};
  
  				}(propertyName, propertyValue));
  			}
  		}
  		/* eslint-enable guard-for-in, no-loop-func */
  	}
docs: Wraps all methods on an object with try-catch so that objects don't need
  to worry about trapping their own errors. When an error occurs, the
  error event is fired with the error information.
  @see http://www.nczonline.net/blog/2009/04/28/javascript-error-handling-anti-pattern/
  @param {Object} object Any object whose public methods should be wrapped.
  @param {string} objectName The name that should be reported for the object
  when an error occurs.
  @returns {void}
  @private