2👍
✅
By default the exception argument is stored in the message
field.
You can get it out with
data = e.message
and if you want to you can alter it with
e.message['bananas'] = 'custard'
Source:stackexchange.com