code: function buildErrorObject(error) {
  		var msg = error.message || 'Unknown error occurred';
  		var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
  		var ErrConstructor = window[errorName] || Error;
  
  		if (error.stack) {
  			msg += '\n' + error.stack.replace(error.message, '');
  		}
  		return new ErrConstructor(msg);
  	}
docs: Convert a javascript Error into something that can be stringified
  @param  {Error} error  Any type of error
  @return {Object}       Processable object