Skip to content

Choosing Exceptions to Raise

Phillip Cloud edited this page Sep 7, 2013 · 5 revisions

This is an opinionated (start) to a guide to using Exceptions in Pandas.

Overall: use builtin exceptions wherever possible and avoid using raise Exception!

Builtin Exceptions

Again, looking at the docs on builtin exceptions is the best way to decide which to use (even includes explanations of what each sort of Exception is meant for).

Using Pandas-provided Exceptions

Unless you see a very specific need (like using Exceptions to signal or an error that just doesn't fit in any other way), you should use builtin exceptions.