an except clause without a named exception can be used to catch any type of exception code example
Example 1: python except print error type
>>> try:
... raise Exception('spam', 'eggs')
... except Exception as inst:
... print(type(inst))
... print(inst.args)
... print(inst)
...
... x, y = inst.args
... print('x =', x)
... print('y =', y)
...
<class 'Exception'>
('spam', 'eggs')
('spam', 'eggs')
x = spam
y = eggs
Example 2: catch error data with except python
import sys
try:
S = 1/0
except:
e = sys.exc_info()
print(e)
try:
S = 1/0
except ZeroDivisionError as e:
print(e)