5.3.1. patsy.parse_formula.PatsyError¶
-
exception
patsy.parse_formula.PatsyError(message, origin=None)[source]¶ This is the main error type raised by Patsy functions.
In addition to the usual Python exception features, you can pass a second argument to this function specifying the origin of the error; this is included in any error message, and used to help the user locate errors arising from malformed formulas. This second argument should be an
Originobject, or else an arbitrary object with a.originattribute. (If it is neither of these things, then it will simply be ignored.)For ordinary display to the user with default formatting, use
str(exc). If you want to do something cleverer, you can use the.messageand.originattributes directly. (The latter may be None.)