pdfjs/web/viewer.js
function pdfViewError(message, moreInfo) {
          var moreInfoText = mozL10n.get('error_version_info', {
            version: pdfjsLib.version || '?',
            build: pdfjsLib.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 errorWrapperConfig = this.appConfig.errorWrapper;
          var errorWrapper = errorWrapperConfig.container;
          errorWrapper.removeAttribute('hidden');
          var errorMessage = errorWrapperConfig.errorMessage;
          errorMessage.textContent = message;
          var closeButton = errorWrapperConfig.closeButton;
          closeButton.onclick = function () {
            errorWrapper.setAttribute('hidden', 'true');
          };
          var errorMoreInfo = errorWrapperConfig.errorMoreInfo;
          var moreInfoButton = errorWrapperConfig.moreInfoButton;
          var lessInfoButton = errorWrapperConfig.lessInfoButton;
          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: pdfjsLib.version || '?',
            build: pdfjsLib.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 errorWrapperConfig = this.appConfig.errorWrapper;
          var errorWrapper = errorWrapperConfig.container;
          errorWrapper.removeAttribute('hidden');
          var errorMessage = errorWrapperConfig.errorMessage;
          errorMessage.textContent = message;
          var closeButton = errorWrapperConfig.closeButton;
          closeButton.onclick = function () {
            errorWrapper.setAttribute('hidden', 'true');
          };
          var errorMoreInfo = errorWrapperConfig.errorMoreInfo;
          var moreInfoButton = errorWrapperConfig.moreInfoButton;
          var lessInfoButton = errorWrapperConfig.lessInfoButton;
          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 : pdfjsLib . version || '?' , build : pdfjsLib . 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 errorWrapperConfig = this . appConfig . errorWrapper ; var errorWrapper = errorWrapperConfig . container ; errorWrapper . removeAttribute ( 'hidden' ) ; var errorMessage = errorWrapperConfig . errorMessage ; errorMessage . textContent = message ; var closeButton = errorWrapperConfig . closeButton ; closeButton . onclick = function ( ) { errorWrapper . setAttribute ( 'hidden' , 'true' ) ; } ; var errorMoreInfo = errorWrapperConfig . errorMoreInfo ; var moreInfoButton = errorWrapperConfig . moreInfoButton ; var lessInfoButton = errorWrapperConfig . lessInfoButton ; 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 .