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:
  • error_code (str)

  • request_id (str | None)

  • artifact_path (str | None)

Notes

Bug fixes applied (three defects present in the original upstream):

  1. self.ctx was never initialised when both request_id and artifact_path were None, causing AttributeError inside super().__init__(). Now defaults to "unknown".

  2. The second branch was elif error_code == -1: — identical to the if above it, making the corrupted-state path dead code. Replaced with the correct string sentinel "INVALID_STATE", matching what ScikitplotTraceDataCorrupted actually passes.

  3. ScikitplotTraceDataNotFound passes "NOT_FOUND" and ScikitplotTraceDataCorrupted passes "INVALID_STATE" as error_code, but the old comparisons used integer literals (-1), so no branch ever matched and super().__init__() was never called, leaving the exception object in an uninitialised state. Comparisons now use the correct string sentinels.

Annotation:

Unrecognized objtype: exception

Parameters:
  • error_code (str)

  • request_id (str | None)

  • artifact_path (str | None)