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

include segment name and file name for exception #15

Closed
philippb opened this issue Oct 21, 2015 · 3 comments
Closed

include segment name and file name for exception #15

philippb opened this issue Oct 21, 2015 · 3 comments
Assignees
Milestone

Comments

@philippb
Copy link
Contributor

When throwing an exception. include the file name and the segment ID so it's easier to find where the error is.

e.g.

Traceback (most recent call last):
  File "/Users/philipp/coding/ks-email-parser/venv/bin/ks-email-parser", line 9, in <module>
    load_entry_point('ks-email-parser==0.2.6', 'console_scripts', 'ks-email-parser')()
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/__init__.py", line 62, in main
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/__init__.py", line 31, in parse_emails
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/renderer.py", line 177, in render
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/renderer.py", line 102, in render
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/renderer.py", line 102, in <dictcomp>
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/renderer.py", line 83, in _render_placeholder
  File "/Users/philipp/coding/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/renderer.py", line 56, in _inline_css
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/xml/etree/ElementTree.py", line 1325, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 6, column 24
@ca77y ca77y modified the milestone: Week 6 Feb 5, 2016
@philippb
Copy link
Contributor Author

segment ID is the name of the string.

<string name"segment_id">Content</string>

snejku added a commit that referenced this issue Feb 15, 2016
@snejku
Copy link
Contributor

snejku commented Feb 15, 2016

@philippb, @ca77y
New sample output

$ ks-email-parser
F.....
ERRORS:
1. Unable to read content from /Users/snejku/keepsafe/ks-email-parser/src/en/email.xml
not well-formed (invalid token): line 5, column 28
Segment ID: content
_______________
    <string name="content"><<Dummy content</string>
                            ^
Traceback (most recent call last):
  File "/Users/snejku/keepsafe/ks-email-parser/venv/lib/python3.4/site-packages/ks_email_parser-0.2.6-py3.4.egg/email_parser/reader.py", line 67, in read
    tree = ElementTree.parse(email_path)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/xml/etree/ElementTree.py", line 1186, in parse
    tree.parse(source, parser)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/xml/etree/ElementTree.py", line 598, in parse
    self._root = parser._parse_whole(source)
  File "<string>", line None
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 5, column 28

All done

@ca77y
Copy link
Contributor

ca77y commented Feb 15, 2016

Looks good

@ca77y ca77y assigned ca77y and unassigned snejku Feb 17, 2016
ca77y added a commit that referenced this issue Feb 19, 2016
@ca77y ca77y closed this as completed Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants