code: function(obj) {
        if (this.isRecurrenceException()) {
          throw new Error('cannot relate exception to exceptions');
        }
  
        if (obj instanceof ICAL.Component) {
          obj = new ICAL.Event(obj);
        }
  
        if (this.strictExceptions && obj.uid !== this.uid) {
          throw new Error('attempted to relate unrelated exception');
        }
  
        var id = obj.recurrenceId.toString();
  
        // we don't sort or manage exceptions directly
        // here the recurrence expander handles that.
        this.exceptions[id] = obj;
  
        // index RANGE=THISANDFUTURE exceptions so we can
        // look them up later in getOccurrenceDetails.
        if (obj.modifiesFuture()) {
          var item = [
            obj.recurrenceId.toUnixTime(), id
          ];
  
          // we keep them sorted so we can find the nearest
          // value later on...
          var idx = ICAL.helpers.binsearchInsert(
            this.rangeExceptions,
            item,
            compareRangeException
          );
  
          this.rangeExceptions.splice(idx, 0, item);
        }
      }
docs: Relates a given event exception to this object.  If the given component
  does not share the UID of this event it cannot be related and will throw
  an exception.
  
  If this component is an exception it cannot have other exceptions
  related to it.
  
  @param {ICAL.Component|ICAL.Event} obj       Component or event