Registry / devops / diagnostic

diagnostic

JSON →
library3.0.0pypypi✓ verified 85d ago

A minimal library for presenting structured error chains with causes, context, and more, enabling better debugging in Python >=3.10. Current version: 3.0.0. Release cadence is irregular.

pip install diagnostic
INSTALL
IMPORT
SIG · DIAGNOSTIC
D
diagnostic
devopspythonv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DiagnosticError
from diagnostic import DiagnosticError
from diagnostic.error import DiagnosticError
DiagnosticError is a top-level name, not a submodule.
present
from diagnostic import present
from diagnostic.formatters import present
present is a top-level function.

Create a diagnostic error with cause and print a formatted presentation.

from diagnostic import DiagnosticError, present try: raise DiagnosticError("Something went wrong", cause=ValueError("Invalid input")) except DiagnosticError as e: print(present(e))
Debug
Known issues
breakingVersion 3.0.0 dropped support for Python < 3.10. Required Python version is now >=3.10.
fix
Upgrade Python to 3.10 or later, or pin diagnostic to <3.0.0.
affects: 3.0.0
gotchaDiagnosticError is not a subclass of Exception; it must be caught explicitly and not as a generic Exception. Using `except Exception:` will not catch DiagnosticError.
fix
Always catch DiagnosticError explicitly, or use `except BaseException:` if you must catch everything (not recommended).
affects: all
deprecatedThe `DiagnosticError.with_cause` class method is deprecated in 3.0.0; pass `cause` to the constructor directly.
fix
Use `DiagnosticError('message', cause=exc)` instead of `DiagnosticError.with_cause('message', exc)`.
affects: 3.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'DiagnosticError' from 'diagnostic'
Installed version may be <3.0.0 where DiagnosticError was not exported at top level, or you have a local file named diagnostic.py shadowing the package.
fix
Uninstall any local diagnostic.py, then `pip install --upgrade diagnostic` (>=3.0.0).
AttributeError: 'DiagnosticError' object has no attribute 'cause'
Older versions used a different attribute name (e.g., '__cause__'). The current API uses `cause`, but only if provided.
fix
Check version: if <3.0.0, use `e.__cause__`; if >=3.0.0, use `e.cause`.
TypeError: present() missing 1 required positional argument: 'error'
Calling `present()` without arguments. The function expects a `DiagnosticError` instance.
fix
Pass the error: `present(error_instance)`.
Upgrade
Version history
3.0.0latest on PyPI · released Dec 15, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
diagnostic — pip install diagnostic · libregistry