function pdfViewError(message, moreInfo) {
    var moreInfoText = mozL10n.get('error_version_info',
      {version: PDFJS.version || '?', build: PDFJS.build || '?'},
      'PDF.js v{{version}} (build: {{build}})') + '\n';
    if (moreInfo) {
      moreInfoText +=
        mozL10n.get('error_message', {message: moreInfo.message},
        'Message: {{message}}');
      if (moreInfo.stack) {
        moreInfoText += '\n' +
          mozL10n.get('error_stack', {stack: moreInfo.stack},
          'Stack: {{stack}}');
      } else {
        if (moreInfo.filename) {
          moreInfoText += '\n' +
            mozL10n.get('error_file', {file: moreInfo.filename},
            'File: {{file}}');
        }
        if (moreInfo.lineNumber) {
          moreInfoText += '\n' +
            mozL10n.get('error_line', {line: moreInfo.lineNumber},
            'Line: {{line}}');
        }
      }
    }

    var errorWrapper = document.getElementById('errorWrapper');
    errorWrapper.removeAttribute('hidden');

    var errorMessage = document.getElementById('errorMessage');
    errorMessage.textContent = message;

    var closeButton = document.getElementById('errorClose');
    closeButton.onclick = function() {
      errorWrapper.setAttribute('hidden', 'true');
    };

    var errorMoreInfo = document.getElementById('errorMoreInfo');
    var moreInfoButton = document.getElementById('errorShowMore');
    var lessInfoButton = document.getElementById('errorShowLess');
    moreInfoButton.onclick = function() {
      errorMoreInfo.removeAttribute('hidden');
      moreInfoButton.setAttribute('hidden', 'true');
      lessInfoButton.removeAttribute('hidden');
      errorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px';
    };
    lessInfoButton.onclick = function() {
      errorMoreInfo.setAttribute('hidden', 'true');
      moreInfoButton.removeAttribute('hidden');
      lessInfoButton.setAttribute('hidden', 'true');
    };
    moreInfoButton.oncontextmenu = noContextMenuHandler;
    lessInfoButton.oncontextmenu = noContextMenuHandler;
    closeButton.oncontextmenu = noContextMenuHandler;
    moreInfoButton.removeAttribute('hidden');
    lessInfoButton.setAttribute('hidden', 'true');
    errorMoreInfo.value = moreInfoText;
  }
/**
   * Show the error box.
   * @param {String} message A message that is human readable.
   * @param {Object} moreInfo (optional) Further information about the error
   *                            that is more technical.  Should have a 'message'
   *                            and optionally a 'stack' property.
   */
Show the error box.
@param {String} message A message that is human readable.
@param {Object} moreInfo (optional) Further information about the error
that is more technical.  Should have a 'message'
and optionally a 'stack' property.
Show the error box . @param { String } message A message that is human readable . @param { Object } moreInfo ( optional ) Further information about the error that is more technical . Should have a ' message ' and optionally a ' stack ' property .
function pdfViewError(message, moreInfo) {
    var moreInfoText = mozL10n.get('error_version_info',
      {version: PDFJS.version || '?', build: PDFJS.build || '?'},
      'PDF.js v{{version}} (build: {{build}})') + '\n';
    if (moreInfo) {
      moreInfoText +=
        mozL10n.get('error_message', {message: moreInfo.message},
        'Message: {{message}}');
      if (moreInfo.stack) {
        moreInfoText += '\n' +
          mozL10n.get('error_stack', {stack: moreInfo.stack},
          'Stack: {{stack}}');
      } else {
        if (moreInfo.filename) {
          moreInfoText += '\n' +
            mozL10n.get('error_file', {file: moreInfo.filename},
            'File: {{file}}');
        }
        if (moreInfo.lineNumber) {
          moreInfoText += '\n' +
            mozL10n.get('error_line', {line: moreInfo.lineNumber},
            'Line: {{line}}');
        }
      }
    }
    var errorWrapper = document.getElementById('errorWrapper');
    errorWrapper.removeAttribute('hidden');
    var errorMessage = document.getElementById('errorMessage');
    errorMessage.textContent = message;
    var closeButton = document.getElementById('errorClose');
    closeButton.onclick = function() {
      errorWrapper.setAttribute('hidden', 'true');
    };
    var errorMoreInfo = document.getElementById('errorMoreInfo');
    var moreInfoButton = document.getElementById('errorShowMore');
    var lessInfoButton = document.getElementById('errorShowLess');
    moreInfoButton.onclick = function() {
      errorMoreInfo.removeAttribute('hidden');
      moreInfoButton.setAttribute('hidden', 'true');
      lessInfoButton.removeAttribute('hidden');
      errorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px';
    };
    lessInfoButton.onclick = function() {
      errorMoreInfo.setAttribute('hidden', 'true');
      moreInfoButton.removeAttribute('hidden');
      lessInfoButton.setAttribute('hidden', 'true');
    };
    moreInfoButton.oncontextmenu = noContextMenuHandler;
    lessInfoButton.oncontextmenu = noContextMenuHandler;
    closeButton.oncontextmenu = noContextMenuHandler;
    moreInfoButton.removeAttribute('hidden');
    lessInfoButton.setAttribute('hidden', 'true');
    errorMoreInfo.value = moreInfoText;
  }
function pdfViewError ( message , moreInfo ) { var moreInfoText = mozL10n . get ( 'error_version_info' , { version : PDFJS . version || '?' , build : PDFJS . build || '?' } , 'PDF.js v{{version}} (build: {{build}})' ) + '\n' ; if ( moreInfo ) { moreInfoText += mozL10n . get ( 'error_message' , { message : moreInfo . message } , 'Message: {{message}}' ) ; if ( moreInfo . stack ) { moreInfoText += '\n' + mozL10n . get ( 'error_stack' , { stack : moreInfo . stack } , 'Stack: {{stack}}' ) ; } else { if ( moreInfo . filename ) { moreInfoText += '\n' + mozL10n . get ( 'error_file' , { file : moreInfo . filename } , 'File: {{file}}' ) ; } if ( moreInfo . lineNumber ) { moreInfoText += '\n' + mozL10n . get ( 'error_line' , { line : moreInfo . lineNumber } , 'Line: {{line}}' ) ; } } } var errorWrapper = document . getElementById ( 'errorWrapper' ) ; errorWrapper . removeAttribute ( 'hidden' ) ; var errorMessage = document . getElementById ( 'errorMessage' ) ; errorMessage . textContent = message ; var closeButton = document . getElementById ( 'errorClose' ) ; closeButton . onclick = function ( ) { errorWrapper . setAttribute ( 'hidden' , 'true' ) ; } ; var errorMoreInfo = document . getElementById ( 'errorMoreInfo' ) ; var moreInfoButton = document . getElementById ( 'errorShowMore' ) ; var lessInfoButton = document . getElementById ( 'errorShowLess' ) ; moreInfoButton . onclick = function ( ) { errorMoreInfo . removeAttribute ( 'hidden' ) ; moreInfoButton . setAttribute ( 'hidden' , 'true' ) ; lessInfoButton . removeAttribute ( 'hidden' ) ; errorMoreInfo . style . height = errorMoreInfo . scrollHeight + 'px' ; } ; lessInfoButton . onclick = function ( ) { errorMoreInfo . setAttribute ( 'hidden' , 'true' ) ; moreInfoButton . removeAttribute ( 'hidden' ) ; lessInfoButton . setAttribute ( 'hidden' , 'true' ) ; } ; moreInfoButton . oncontextmenu = noContextMenuHandler ; lessInfoButton . oncontextmenu = noContextMenuHandler ; closeButton . oncontextmenu = noContextMenuHandler ; moreInfoButton . removeAttribute ( 'hidden' ) ; lessInfoButton . setAttribute ( 'hidden' , 'true' ) ; errorMoreInfo . value = moreInfoText ; }
Show the error box.
Show the error box .