ScikitplotException#
- exception scikitplot.exceptions.ScikitplotException(message, error_code=0, **kwargs)[source]#
Generic exception thrown to surface failure information about external-facing operations.
The error message associated with this exception may be exposed to clients in HTTP responses for debugging purposes. If the error text is sensitive, raise a generic
Exceptionobject instead.- Parameters:
- messagestr or Exception
The message or exception describing the error that occurred. Converted to
strunconditionally. Included in the serialised JSON payload.- error_codeint or str, optional
An error code for the error that occurred. May be an integer (legacy convention) or a string sentinel such as
"NOT_FOUND". Defaults to0. Included in the serialised JSON payload.- **kwargs
Additional key-value pairs included in the serialised JSON payload. Values must be JSON-serialisable; non-serialisable values are coerced to their
strrepresentation during serialisation.
- Attributes:
- error_codeint or str
The error code as supplied.
- messagestr
The string form of the supplied message.
- json_kwargsdict
The extra keyword arguments to include in the JSON payload.
Notes
User note – catch this class (or its subclasses) when you need to distinguish scikit-plots operational errors from other
Exceptiontypes.Developer note –
error_codeis stored verbatim; do not apply integer-only logic elsewhere in the codebase without first checking its type. Thetry/exceptthat previously guarded the attribute assignment was dead code (attribute assignment never raisesValueErrororTypeError) and has been removed.- Annotation:
Unrecognized objtype:
exception