Standardize error handling to three-tuple map details#14
Open
coryodaniel wants to merge 4 commits intomainfrom
Open
Standardize error handling to three-tuple map details#14coryodaniel wants to merge 4 commits intomainfrom
coryodaniel wants to merge 4 commits intomainfrom
Conversation
User prompts:
- "Expand registry error results to include details from storage adapters"
- "make the registry do most of the error handling, check for repo/upload existence early"
- "come up with a good error struct standard"
- "bump the minor level and open a PR"
Changes:
- Standardize all errors to {:error, atom_code, map()} three-tuple
- Add ensure_repo_exists/3 and ensure_upload_exists/4 precondition helpers to Registry
- Registry now checks repo/upload existence before delegating to storage
- Fix unhandled `false` fall-through in upload_blob_chunk and complete_blob_upload
- Convert all string error details to structured maps across auth, storage, handler
- Remove two-tuple error match from Handler (and the placeholder message)
- Update Storage.Adapter and Auth.Adapter callback specs to enforce map details
- Bump version to 0.2.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User prompts: - "add a credo ignore rule for ABC size on context.ex" Changes: - Add credo:disable-for-next-line for Credo.Check.Refactor.ABCSize on Context.call Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User prompts: - "we need the raw http body to properly hash, currently we parse and pass on the json object in parse_oci_manifest" - "store the raw and digest in assigns, pass manifest, manifest_raw, and digest to store_manifest" Changes: - Parser stores raw body in conn.assigns[:oci_raw_manifest] alongside digest - Handler passes parsed manifest, raw bytes, and digest to Registry.store_manifest - Registry uses parsed map for validation/indexing, raw bytes for storage - Local storage writes raw bytes to disk instead of re-encoding JSON - Storage adapter callback type updated from map() to binary() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User prompts: - "pass the parsed map to store_manifest so they dont have to reparse" Changes: - Storage adapter callback accepts both manifest (map) and raw_manifest (binary) - Registry passes both through to the adapter - Local adapter receives parsed map for future use, writes raw bytes to disk Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
{:error, atom_code, map()}— eliminates the inconsistent mix of two-tuples, string details, and map detailsensure_repo_exists/3andensure_upload_exists/4precondition helpers in Registry so it validates state before delegating to storage adapters (fixes unhandledfalsefall-through fromupload_exists?inwithblocks)Test plan
mix compile --warnings-as-errorsclean🤖 Generated with Claude Code