Skip to content
Advertisement

How to get python default exception message in exception handling

When I handle an exception in python

JavaScript

It prints

JavaScript

I expect it to print

JavaScript

Is there a way to retrieve the default error message ?

Advertisement

Answer

Instead of this:

JavaScript

do this:

JavaScript

or just this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement