Summary
The SDK defines three exceptions in src/hiero_sdk_python/exceptions.py — PrecheckError, MaxAttemptsError, and ReceiptStatusError — but there is no user-facing documentation explaining when they are thrown, what their attributes mean, or how to handle them.
The existing docs/sdk_developers/training/receipt_status_error.md is written for SDK contributors, not end users. The docs/sdk_users/ directory currently contains only running_examples.md and transaction_bytes.md — nothing about errors.
Current Behavior
A developer using the SDK has no reference for error handling. They must read source code to understand what to catch:
try:
receipt = await transaction.execute(client).get_receipt(client)
except ???: # PrecheckError? ReceiptStatusError? Something else?
pass
Expected Behavior
Add docs/sdk_users/error_handling.md covering:
PrecheckError — thrown when a transaction fails pre-consensus validation. Attributes: status (ResponseCode), transaction_id.
MaxAttemptsError — thrown when all retry attempts to a node are exhausted. Attributes: node_id, last_error.
ReceiptStatusError — thrown when a receipt contains a non-SUCCESS status. Attributes: status, transaction_id, transaction_receipt.
- How to read
ResponseCode values to understand the failure reason.
- A practical example showing all three in a single try/except block.
- Retry and backoff guidance (when to retry vs. when to give up).
Example Output
from hiero_sdk_python.exceptions import PrecheckError, MaxAttemptsError, ReceiptStatusError
from hiero_sdk_python.response_code import ResponseCode
try:
receipt = transaction.execute(client).get_receipt(client)
except PrecheckError as e:
print(f"Transaction rejected before consensus: {e.status.name}")
except ReceiptStatusError as e:
print(f"Transaction reached consensus but failed: {e.status.name}")
except MaxAttemptsError as e:
print(f"Could not reach node {e.node_id}: {e.last_error}")
Why This Is Distinct
Suggested Location
docs/sdk_users/error_handling.md with a link added to docs/sdk_users/running_examples.md and the main README.
Environment
- SDK version: v0.2.6
- Exceptions defined in:
src/hiero_sdk_python/exceptions.py
- Response codes defined in:
src/hiero_sdk_python/response_code.py
Summary
The SDK defines three exceptions in
src/hiero_sdk_python/exceptions.py—PrecheckError,MaxAttemptsError, andReceiptStatusError— but there is no user-facing documentation explaining when they are thrown, what their attributes mean, or how to handle them.The existing
docs/sdk_developers/training/receipt_status_error.mdis written for SDK contributors, not end users. Thedocs/sdk_users/directory currently contains onlyrunning_examples.mdandtransaction_bytes.md— nothing about errors.Current Behavior
A developer using the SDK has no reference for error handling. They must read source code to understand what to catch:
Expected Behavior
Add
docs/sdk_users/error_handling.mdcovering:PrecheckError— thrown when a transaction fails pre-consensus validation. Attributes:status(ResponseCode),transaction_id.MaxAttemptsError— thrown when all retry attempts to a node are exhausted. Attributes:node_id,last_error.ReceiptStatusError— thrown when a receipt contains a non-SUCCESSstatus. Attributes:status,transaction_id,transaction_receipt.ResponseCodevalues to understand the failure reason.Example Output
Why This Is Distinct
docs/sdk_developers/training/receipt_status_error.md(closed issues Create docs/sdk_developers/training/precheck_error.md #876–Create docs/sdk_developers/training/receipt_status_error.md #878) covers one exception for contributors learning the internals.Suggested Location
docs/sdk_users/error_handling.mdwith a link added todocs/sdk_users/running_examples.mdand the main README.Environment
src/hiero_sdk_python/exceptions.pysrc/hiero_sdk_python/response_code.py