Open ChrisBeaumont opened 9 years ago
Yes!
I believe there should be a way to make exceptions more friendly.
I can see a few different improvements:
1) choose to show shorter messages (like not showing all the recursive "proof" of contract violation)
2) showing more context, like the signature of the function + the function call.
3) censoring out the pycontracts-specific stack frames from the exceptions.
The exception messages on contract failures can be very long, which makes it more difficult to find the context of the code where the contract failed. I wonder if the standard contract message should try to re-embed some of the lines surrounding the failure location towards the bottom of the exception message?