handleError(event) {
    shaka.log.debug(
        'PatchedMediaKeysWebkit.MediaKeySession.handleError', event);

    // This does not match the DOMException we get in current WD EME, but it
    // will at least provide some information which can be used to look into the
    // problem.
    const error = new Error('EME v0.1b key error');
    const errorCode = event.errorCode;
    errorCode.systemCode = event.systemCode;
    error['errorCode'] = errorCode;

    // The presence or absence of sessionId indicates whether this corresponds
    // to generateRequest() or update().
    if (!event.sessionId && this.generatePromise_) {
      if (event.systemCode == 45) {
        error.message = 'Unsupported session type.';
      }
      this.generatePromise_.reject(error);
      this.generatePromise_ = null;
    } else if (event.sessionId && this.updatePromise_) {
      this.updatePromise_.reject(error);
      this.updatePromise_ = null;
    } else {
      // This mapping of key statuses is imperfect at best.
      const code = event.errorCode.code;
      const systemCode = event.systemCode;
      if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {
        this.updateKeyStatus_('output-restricted');
      } else if (systemCode == 1) {
        this.updateKeyStatus_('expired');
      } else {
        this.updateKeyStatus_('internal-error');
      }
    }
  }
Either rejects a promise, or dispatches an error event, as appropriate.

@param {!MediaKeyEvent} event