AgentError#
- class scikitplot.agent.AgentError(code, message, details=<factory>)[source]#
One error, as recorded in a run’s state and audit trail.
- Parameters:
- codeErrorCode
What went wrong.
- messagestr
A sentence a person can act on.
- detailsmapping, default={}
JSON-compatible facts (the gate, the limit, the tool, …).
- Raises:
- TypeError
If
codeis not anErrorCode(or its value) ormessageis not a string.
- Parameters:
Examples
>>> from scikitplot.agent import AgentError, ErrorCode >>> err = AgentError(ErrorCode.SCOPE_DENIED, "needs 'corpus:read'") >>> err.to_dict()["code"] 'scope_denied' >>> AgentError.from_dict(err.to_dict()) == err True