Repository navigation
fix(errors): native errors name dynamoxy.errors as their module - #145
Merged
kalaspuff merged 1 commit intoOct 31, 2026
Merged
Conversation
The error classes raised by the Rust core (AccessDeniedError, ThrottlingError, ValidationError, ...) are the classes dynamoxy.errors exports, but they named dynamoxy._core as their module, so tracebacks showed dynamoxy._core.AccessDeniedError next to dynamoxy.errors.ItemAlreadyExistsError for the Python-defined ones. They now name dynamoxy.errors, which re-exports them, so pickle still finds them. Co-authored-by: Carl Oscar Aaro <[email protected]>
kalaspuff
deleted the
fctl/152-when-making-connections-without-any-cred
branch
October 31, 2026 13:26
This was referenced Oct 31, 2026
kalaspuff
added a commit
to kalaspuff/fanferro
that referenced
this pull request
Oct 31, 2026
## Summary The error classes raised by the Rust core (`AccessDeniedError`, `ResourceNotFoundError`, `ThrottledError`, `ValidationError`, …) are the same classes `fanferro.errors` exports, so `except fanferro.errors.AccessDeniedError` already caught them, but they named `_core` as their module, a name that cannot be imported. Tracebacks showed `_core.AccessDeniedError` while the Python-defined errors showed `fanferro.errors.ProvisioningError`; the `error_type` of events and of the `fanferro.dead-letter` metadata, and OpenTelemetry's `error.type`, recorded `_core.AccessDeniedError`; and pickling one failed with `PicklingError: Can't pickle <class '_core.AccessDeniedError'>: No module named '_core'`, so an error raised in a worker process or a task queue could not reach its caller. They now name `fanferro.errors`, so tracebacks end in `fanferro.errors.AccessDeniedError: …`, and pickle finds the classes there and keeps their attributes (`code`, `request_id`, `retryable`, …). This follows dynamoxy's change of the same name. Verified with a unit test that, for every native error class, checks its module, that `fanferro.errors` holds that very class, the traceback line, `error_type` and a pickle round trip, and one that pickles a `ResourceNotFoundError` from the memory broker with its AWS attributes; `make check`'s steps pass (cargo fmt and clippy, ruff, pyrefly, the consistency checks and `uv run pytest`). `BatchPublishError` and `ProvisioningError`, defined in Python with a second constructor argument, still cannot be unpickled, as before: #164 tracks that. - kalaspuff/dynamoxy#145 ## Worth confirming - **Decision:** The `error_type` value in `fanferro.dead-letter` metadata, events and OpenTelemetry spans changes from `_core.AccessDeniedError` to `fanferro.errors.AccessDeniedError`. Dashboards or alerts that match the old string need updating; I did not treat it as a breaking change, since `_core.…` was never a name an application could import. [fctl session](https://app.fctl.sh/s/ses_01M69NKFXEW5AAV8A1AK2Y1NBQ) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Low risk.** It only changes the module name recorded on the native error classes; the classes, hierarchy and catching behavior stay the same, and the only visible difference is the `error_type` string. > > **What it does.** The error classes raised by the Rust core now name `fanferro.errors` as their module instead of the unimportable `_core`. Tracebacks show the public name and the errors can be pickled with their attributes. A test checks every native error class, and the errors reference and module docs are updated. > > **error_type string changes.** The `error_type` in events, dead-letter metadata and OpenTelemetry `error.type` changes from `_core.AccessDeniedError` to `fanferro.errors.AccessDeniedError`, so dashboards or alerts matching the old string need updating. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M69P7RETV4MFACJ4NVT8D1MV)'s first look at [`be8af87`](be8af87) · 4 files, +72 −16 · [Review agent settings](https://app.fctl.sh/p/fanferro?tab=reviews)</sub> <!-- /FCTL_REVIEW_SUMMARY --> Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com> Co-authored-by: Carl Oscar Aaro <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The error classes raised by the Rust core (
AccessDeniedError,ThrottlingError,ValidationError,ResourceNotFoundError, …) are the same classesdynamoxy.errorsexports, soexcept dynamoxy.errors.AccessDeniedErroralready caught them, but they named the native module as theirs: tracebacks showed_core.AccessDeniedError(dynamoxy._core.AccessDeniedErrorsince #72) while the Python-defined errors showeddynamoxy.errors.ItemAlreadyExistsError. They now namedynamoxy.errors, so a failed call without valid credentials ends indynamoxy.errors.AccessDeniedError: ListTables failed: UnrecognizedClientException: ….dynamoxy.errorsre-exports every native class, sopicklefinds them there, and pickles written with the old module name still load becausedynamoxy._corekeeps the classes.Verified with the unit test that round-trips every native error class, which now also checks its module, that
dynamoxy.errorsholds that very class, and the traceback line; by callinglist_tables()on AWS with invalid credentials; and withmake check.Worth confirming
dynamoxy._core) to saydynamoxy.errors, rather than adding a second entry, since neither name has been released after 0.3.0's_core.fctl session
Note
Low risk. It only changes the module name the native error classes report; the classes, their hierarchy and
exceptmatching stay the same. Pickles use the new module name, and old pickles still load becausedynamoxy._corekeeps the classes.What it does. The error classes raised by the Rust core (
AccessDeniedError,ThrottlingError,ValidationError, and so on) now namedynamoxy.errorsas their module instead ofdynamoxy._core. Tracebacks then showdynamoxy.errors.AccessDeniedErrorlike the Python-defined errors, andpicklefinds the classes indynamoxy.errors, which re-exports them. The unit test, the guide and the unreleased changelog entry are updated to match.fctl review's first look at
40d85ad· 4 files, +34 −25 · Review agent settings