ScikitplotTraceDataException#
- exception scikitplot.exceptions.ScikitplotTraceDataException(error_code, request_id=None, artifact_path=None)[source]#
Exception thrown for trace data related errors.
- Parameters:
- error_codestr
A string identifier for the error kind. Recognised values:
"NOT_FOUND"Trace data could not be located.
"INVALID_STATE"Trace data was found but is corrupted or in an unexpected state.
Any other value produces a generic error message.
- request_idstr or None, optional
The trace request identifier to include in the error message. Takes priority over artifact_path when both are supplied.
- artifact_pathstr or None, optional
The artifact path to include in the error message. Used only when request_id is
None.
- Attributes:
- ctxstr
The context string embedded in the error message. One of
"request_id=<value>","path=<value>", or"unknown".
- Parameters:
Notes
Bug fixes applied (three defects present in the original upstream):
self.ctxwas never initialised when both request_id and artifact_path wereNone, causingAttributeErrorinsidesuper().__init__(). Now defaults to"unknown".The second branch was
elif error_code == -1:— identical to theifabove it, making the corrupted-state path dead code. Replaced with the correct string sentinel"INVALID_STATE", matching whatScikitplotTraceDataCorruptedactually passes.ScikitplotTraceDataNotFoundpasses"NOT_FOUND"andScikitplotTraceDataCorruptedpasses"INVALID_STATE"as error_code, but the old comparisons used integer literals (-1), so no branch ever matched andsuper().__init__()was never called, leaving the exception object in an uninitialised state. Comparisons now use the correct string sentinels.