takeiteasy/doujin-db — pull request #11 by loli10K (2013-10-13 09:11:43+00:00)
Title: Add exception handling in case of incorrect API key

If you provide a wrong (non-existing) API key mugimugi server responds with a plain HTML (not XML) error page. This leads to incorrect exception handling

```
(python3-doujindb) [root@centos6-devstack doujin-db]# python src/doujin-ren.py
Parsing arguments...DONE!
Loading config (.doujin-ren.conf)...DONE!
Testing config and argument values...DONE!
Checking and testing API key...
Traceback (most recent call last):
File "src/doujin-ren.py", line 528, in
main(sys.argv[1:])
File "src/doujin-ren.py", line 236, in main
api_root = ET.fromstring(api_resp.text)
File "/opt/python3/lib/python3.3/xml/etree/ElementTree.py", line 1356, in XML
parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 1
```

I've added the code to catch this kind of situation.