SatelliteQE / robozilla

Robottelo Bugzilla Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ErrorString is not an Exception

alda519 opened this issue · comments

commented

you cannot except ErrorString like this:

except ErrorString as error:

because ErrorString is not an Exception, it is a function

>>> from xml.parsers.expat import ErrorString
>>> type(ErrorString)
<class 'builtin_function_or_method'>
>>> try:
...   raise Exception()
... except ErrorString:
...   pass
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
Exception

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
TypeError: catching classes that do not inherit from BaseException is not allowed
>>> ErrorString(1)
'out of memory'