Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

actionable-errors

CI Coverage PyPI

Three-audience error framework for Python.

Every ActionableError speaks to three audiences simultaneously:

Audience Uses Provided by
Calling code Typed ErrorType for routing (retry? escalate? ignore?) ErrorType(StrEnum) — 8 base categories
Human operator suggestion + Troubleshooting steps Frozen dataclasses with actionable text
AI agent AIGuidance with concrete next tool calls Frozen dataclass with tool suggestions

Install

pip install actionable-errors

Zero runtime dependencies — stdlib only. Sits at the bottom of every dependency tree.

Quick Start

from actionable_errors import (
    ActionableError,
    AIGuidance,
    ToolResult,
    from_exception,
    sanitize,
)

# Domain-specific factory with built-in defaults
error = ActionableError.authentication(
    service="Azure DevOps",
    raw_error="401 Unauthorized",
)
print(error.suggestion)    # "Check your credentials and try again."
print(error.ai_guidance)   # AIGuidance(action_required="Re-authenticate", command="az login")

# Auto-classify any exception
try:
    raise ConnectionError("Connection refused")
except Exception as exc:
    ae = from_exception(exc, service="Kusto", operation="query")
    print(ae.error_type)   # "connection"

# Typed result envelope for MCP tool responses
result = ToolResult.ok(data={"items": 42})
result = ToolResult.fail(error=error)     # extracts error_type + suggestion

# Credential sanitization
clean = sanitize('password="hunter2" token=abc123')
# → 'password="***" token=***'

Extending ErrorType

Python StrEnum can't be subclassed once it has members, so extend via composition:

from enum import StrEnum
from actionable_errors import ActionableError

class RAGErrorType(StrEnum):
    EMBEDDING = "embedding"
    INDEX = "index"

error = ActionableError(
    error="Vector store unavailable",
    error_type=RAGErrorType.INDEX,
    service="pinecone",
    suggestion="Check Pinecone cluster status.",
)

Factories

Eight domain-specific factories with sensible defaults:

Factory Key Parameters
.authentication(service, raw_error) Default suggestion + AI guidance
.configuration(field_name, reason) —
.connection(service, url, raw_error) —
.timeout(service, operation, timeout_seconds) —
.permission(service, resource, raw_error) —
.validation(service, field_name, reason) —
.not_found(service, resource_type, resource_id, raw_error) —
.internal(service, operation, raw_error) —

All factories accept optional suggestion, ai_guidance, and troubleshooting kwargs.

Development

# Install dev dependencies
uv sync --extra dev

# Run all checks
task check  # lint → type → test (90 tests, 100% coverage)

License

MIT

Metadata

Release files for actionable-errors 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for actionable-errors 0.2.0
File Size Uploaded Provenance
actionable_errors-0.2.0.tar.gz 84.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for actionable-errors 0.2.0
File Interpreter ABI Platform
actionable_errors-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 94.9 kB

Release files / actionable_errors-0.2.0.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL actionable_errors-0.2.0.tar.gz
Size 84.4 kB
Tags Source
SHA-256 checksum
How to use checksums
715170439e1075ae4b4110a490c651fd061cd353f9d838a8d0bbce5e45adb439
BLAKE2b-256 checksum
How to use checksums
6e0e0627633686a0d802b00bd50c55a4318e319fa2722718e31dc0d73dda01d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.

Transparency log

Release files / actionable_errors-0.2.0-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL actionable_errors-0.2.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2cb16b499b86c87ce0c2c5f598c1cf8101551683b2d73eb6af8db98571ed7f
BLAKE2b-256 checksum
How to use checksums
aa1b93cf054ce58cd8b010cf85dd3acb77f72dbc9be12427a4d84e8e736a0125
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.

Transparency log

Security for actionable-errors 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Configuration

  • Removed 0.1.1 publish.yml
  • Added 0.2.0 release.yml
Select from 2 files

Attestation for actionable_errors-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page