Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for long headings #25

Closed
pcraig3 opened this issue Oct 30, 2024 · 3 comments
Closed

Better error message for long headings #25

pcraig3 opened this issue Oct 30, 2024 · 3 comments
Assignees

Comments

@pcraig3
Copy link
Collaborator

pcraig3 commented Oct 30, 2024

When you import a Word document with a really long (paragraph-length) block tagged as a heading, it throws up an exception related to the line length, which originates in the in the model definition for aSection.

This paragraph in the orange box is styled as a Heading 3

This is actually desired behaviour, since we don't ever see headings that are this large. In (probably) every case, these are paragraph elements that have been mistagged as headings.

The problem is that the error message we return to the user doesn't explain the issue very well. It talks about the character length but not about what's the root issue.

Image

This story is about adding an error message that communicates to users what is happening.

What is happening is that they have mistagged paragraph text as heading text. We should tell them some version of this ('this document can't be imported because'), and also indicate where in the document this issue is (either referring to the text itself or the previous heading).

Right now the 400-level error being thrown is a general catch-all error route. Check out this commit for the origin of this: 4981aa4#diff-9438ebabdf1c1d43f10f6eafb9bdcb6459283b95943993031f9660187da51b0fR10

@theresaanna theresaanna self-assigned this Oct 30, 2024
@theresaanna
Copy link

Note to self: message Adam for example error message.

@pcraig3
Copy link
Collaborator Author

pcraig3 commented Oct 30, 2024

Let me know if you need an example document for testing this.

@pcraig3
Copy link
Collaborator Author

pcraig3 commented Dec 13, 2024

This is closed since #97 went in.

@pcraig3 pcraig3 closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants