mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Handle PDF failure error case
GitOrigin-RevId: 902a97f6f454f09345ba4017b50623fd46e57110
This commit is contained in:
parent
a0dd439e2c
commit
07f44b99f4
5 changed files with 74 additions and 27 deletions
|
@ -203,6 +203,11 @@
|
||||||
"no_messages": "",
|
"no_messages": "",
|
||||||
"no_new_commits_in_github": "",
|
"no_new_commits_in_github": "",
|
||||||
"no_other_projects_found": "",
|
"no_other_projects_found": "",
|
||||||
|
"no_pdf_error_explanation": "",
|
||||||
|
"no_pdf_error_reason_unrecoverable_error": "",
|
||||||
|
"no_pdf_error_reason_no_content": "",
|
||||||
|
"no_pdf_error_reason_output_pdf_already_exists": "",
|
||||||
|
"no_pdf_error_title": "",
|
||||||
"no_preview_available": "",
|
"no_preview_available": "",
|
||||||
"no_search_results": "",
|
"no_search_results": "",
|
||||||
"no_symbols_found": "",
|
"no_symbols_found": "",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation, Trans } from 'react-i18next'
|
||||||
import PreviewLogsPaneEntry from './preview-logs-pane-entry'
|
import PreviewLogsPaneEntry from './preview-logs-pane-entry'
|
||||||
import Icon from '../../../shared/components/icon'
|
import Icon from '../../../shared/components/icon'
|
||||||
import { useEditorContext } from '../../../shared/context/editor-context'
|
import { useEditorContext } from '../../../shared/context/editor-context'
|
||||||
|
@ -59,6 +59,30 @@ function PreviewError({ name }) {
|
||||||
} else if (name === 'projectTooLarge') {
|
} else if (name === 'projectTooLarge') {
|
||||||
errorTitle = t('project_too_large')
|
errorTitle = t('project_too_large')
|
||||||
errorContent = <>{t('project_too_much_editable_text')}</>
|
errorContent = <>{t('project_too_much_editable_text')}</>
|
||||||
|
} else if (name === 'failure') {
|
||||||
|
errorTitle = t('no_pdf_error_title')
|
||||||
|
errorContent = (
|
||||||
|
<>
|
||||||
|
<Trans i18nKey="no_pdf_error_explanation" />
|
||||||
|
<ul className="log-entry-formatted-content-list">
|
||||||
|
<li>
|
||||||
|
<Trans i18nKey="no_pdf_error_reason_unrecoverable_error" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Trans
|
||||||
|
i18nKey="no_pdf_error_reason_no_content"
|
||||||
|
components={{ code: <code /> }}
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Trans
|
||||||
|
i18nKey="no_pdf_error_reason_output_pdf_already_exists"
|
||||||
|
components={{ code: <code /> }}
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorTitle ? (
|
return errorTitle ? (
|
||||||
|
|
|
@ -490,6 +490,7 @@ App.controller(
|
||||||
} else if (response.status === 'failure') {
|
} else if (response.status === 'failure') {
|
||||||
$scope.pdf.view = 'errors'
|
$scope.pdf.view = 'errors'
|
||||||
$scope.pdf.failure = true
|
$scope.pdf.failure = true
|
||||||
|
$scope.pdf.downloadUrl = null
|
||||||
$scope.shouldShowLogs = true
|
$scope.shouldShowLogs = true
|
||||||
fetchLogs(fileByPath, { pdfDownloadDomain })
|
fetchLogs(fileByPath, { pdfDownloadDomain })
|
||||||
} else if (response.status === 'clsi-maintenance') {
|
} else if (response.status === 'clsi-maintenance') {
|
||||||
|
@ -515,6 +516,7 @@ App.controller(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.showNewLogsUI) {
|
if (window.showNewLogsUI) {
|
||||||
|
$scope.$applyAsync(() => {
|
||||||
$scope.pdf.compileFailed = false
|
$scope.pdf.compileFailed = false
|
||||||
// `$scope.clsiErrors` stores the error states nested within `$scope.pdf`
|
// `$scope.clsiErrors` stores the error states nested within `$scope.pdf`
|
||||||
// for use with React's <PreviewPane errors={$scope.clsiErrors}/>
|
// for use with React's <PreviewPane errors={$scope.clsiErrors}/>
|
||||||
|
@ -524,13 +526,18 @@ App.controller(
|
||||||
$scope.pdf.renderingError ? { renderingError: true } : null,
|
$scope.pdf.renderingError ? { renderingError: true } : null,
|
||||||
$scope.pdf.clsiMaintenance ? { clsiMaintenance: true } : null,
|
$scope.pdf.clsiMaintenance ? { clsiMaintenance: true } : null,
|
||||||
$scope.pdf.clsiUnavailable ? { clsiUnavailable: true } : null,
|
$scope.pdf.clsiUnavailable ? { clsiUnavailable: true } : null,
|
||||||
$scope.pdf.tooRecentlyCompiled ? { tooRecentlyCompiled: true } : null,
|
$scope.pdf.tooRecentlyCompiled
|
||||||
|
? { tooRecentlyCompiled: true }
|
||||||
|
: null,
|
||||||
$scope.pdf.compileTerminated ? { compileTerminated: true } : null,
|
$scope.pdf.compileTerminated ? { compileTerminated: true } : null,
|
||||||
$scope.pdf.rateLimited ? { rateLimited: true } : null,
|
$scope.pdf.rateLimited ? { rateLimited: true } : null,
|
||||||
$scope.pdf.compileInProgress ? { compileInProgress: true } : null,
|
$scope.pdf.compileInProgress ? { compileInProgress: true } : null,
|
||||||
$scope.pdf.timedout ? { timedout: true } : null,
|
$scope.pdf.timedout ? { timedout: true } : null,
|
||||||
$scope.pdf.projectTooLarge ? { projectTooLarge: true } : null,
|
$scope.pdf.projectTooLarge ? { projectTooLarge: true } : null,
|
||||||
$scope.pdf.autoCompileDisabled ? { autoCompileDisabled: true } : null
|
$scope.pdf.autoCompileDisabled
|
||||||
|
? { autoCompileDisabled: true }
|
||||||
|
: null,
|
||||||
|
$scope.pdf.failure ? { failure: true } : null
|
||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -540,6 +547,7 @@ App.controller(
|
||||||
$scope.shouldShowLogs = true
|
$scope.shouldShowLogs = true
|
||||||
$scope.pdf.compileFailed = true
|
$scope.pdf.compileFailed = true
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const IGNORE_FILES = ['output.fls', 'output.fdb_latexmk']
|
const IGNORE_FILES = ['output.fls', 'output.fdb_latexmk']
|
||||||
|
|
|
@ -175,6 +175,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.log-entry-formatted-content-list {
|
||||||
|
margin: @margin-xs 0;
|
||||||
|
padding-left: @padding-md;
|
||||||
|
}
|
||||||
|
|
||||||
.first-error-popup {
|
.first-error-popup {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
{
|
{
|
||||||
"chat_error": "Could not load chat messages, please try again.",
|
"chat_error": "Could not load chat messages, please try again.",
|
||||||
"reconnect": "Try again",
|
"reconnect": "Try again",
|
||||||
|
"no_pdf_error_title": "No PDF",
|
||||||
|
"no_pdf_error_explanation": "This compile didn't produce a PDF. This can happen if:",
|
||||||
|
"no_pdf_error_reason_unrecoverable_error": "There is an unrecoverable LaTeX error. If there are LaTeX errors shown below or in the raw logs, please try to fix them and compile again.",
|
||||||
|
"no_pdf_error_reason_no_content": "The <code>document</code> environment contains no content. If it's empty, please add some content and compile again.",
|
||||||
|
"no_pdf_error_reason_output_pdf_already_exists": "This project contains a file called <code>output.pdf</code>. If that file exists, please rename it and compile again.",
|
||||||
"logs_pane_info_message": "We are testing a new logs pane",
|
"logs_pane_info_message": "We are testing a new logs pane",
|
||||||
"logs_pane_info_message_popup": "We are testing a new logs pane. Click here to give feedback.",
|
"logs_pane_info_message_popup": "We are testing a new logs pane. Click here to give feedback.",
|
||||||
"github_symlink_error": "Your Github repository contains symbolic link files, which are not currently supported by Overleaf. Please remove these and try again.",
|
"github_symlink_error": "Your Github repository contains symbolic link files, which are not currently supported by Overleaf. Please remove these and try again.",
|
||||||
|
|
Loading…
Reference in a new issue