Merge pull request #9011 from overleaf/jpa-better-render-error-message

[web] provide helpful error message when pdf rendering fails

GitOrigin-RevId: abbe6f362fa362fadee197527463ee675760e581
This commit is contained in:
Jakob Ackermann 2022-07-28 15:39:17 +01:00 committed by Copybot
parent 6485731c98
commit 315414de1b
2 changed files with 16 additions and 2 deletions

View file

@ -16,6 +16,14 @@ function PdfPreviewError({ error }) {
return (
<ErrorLogEntry title={t('pdf_rendering_error')}>
{t('something_went_wrong_rendering_pdf')}
&nbsp;
<Trans
i18nKey="try_recompile_project_or_troubleshoot"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a href="/learn/how-to/Resolving_access%2C_loading%2C_and_display_problems" />,
]}
/>
</ErrorLogEntry>
)

View file

@ -557,7 +557,10 @@ describe('<PdfPreview/>', function () {
cy.wait('@compile-pdf-error')
cy.findByText('Something went wrong while rendering this PDF.')
cy.contains('Something went wrong while rendering this PDF.')
cy.contains(
'Please try recompiling the project from scratch, and if that doesnt help, follow our troubleshooting guide.'
)
cy.findByLabelText('Page 1').should('not.exist')
})
@ -578,7 +581,10 @@ describe('<PdfPreview/>', function () {
cy.wait('@compile-pdf-corrupt')
cy.findByText('Something went wrong while rendering this PDF.')
cy.contains('Something went wrong while rendering this PDF.')
cy.contains(
'Please try recompiling the project from scratch, and if that doesnt help, follow our troubleshooting guide.'
)
cy.findByLabelText('Page 1').should('not.exist')
})
})