Skip to content

Provide more information/context in exceptions#37

Open
ItMightBeKaraoke wants to merge 2 commits into
chireiden:masterfrom
ItMightBeKaraoke:feature/error_context
Open

Provide more information/context in exceptions#37
ItMightBeKaraoke wants to merge 2 commits into
chireiden:masterfrom
ItMightBeKaraoke:feature/error_context

Conversation

@ItMightBeKaraoke
Copy link
Copy Markdown

Currently, many of the exception messages do not provide specifics about the error. This PR adds line number and contents to exceptions from Document.parse_file, and improves some additional exception messages.

In parse_file, add line number and contents to the exception when a line fails to parse so the user has enough information to diagnose the issue.
In Color.from_ass, have the color failure message show the string that fails to parse as a color (so the user can easily see what the issue was, e.g. stray whitespace). Also in LineSection.add_line, put the failing string in quotes so it's more clear it's a literal string from the document.
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

Successfully merging this pull request may close these issues.

1 participant