PyCon 2019 in Cleveland, Ohio

Saturday 3:15 p.m.–3:45 p.m. in Atrium Ballroom AB

Exceptional Exceptions - How to properly raise, handle and create them.

Mario Corchero


Did you know there are multiple ways to raise and capture exceptions? Have you ever wondered if you should raise a built-in exception or create your own hierarchy? Did you ever find it hard to understand what an exception meant? This talk will go through the decisions needed to raise and capture exceptions when creating a library. We will look at how to translate and handle errors, create your own exceptions, and make exceptions clear and easy to troubleshoot, while also understanding how they actually work, common pitfalls.