Skip to content

Standardize error handling to three-tuple map details#14

Open
coryodaniel wants to merge 2 commits intomainfrom
refactor/standardize-error-handling
Open

Standardize error handling to three-tuple map details#14
coryodaniel wants to merge 2 commits intomainfrom
refactor/standardize-error-handling

Conversation

@coryodaniel
Copy link
Copy Markdown
Member

Summary

  • Standardize all error returns across Registry, Storage, Auth, and Handler to {:error, atom_code, map()} — eliminates the inconsistent mix of two-tuples, string details, and map details
  • Add ensure_repo_exists/3 and ensure_upload_exists/4 precondition helpers in Registry so it validates state before delegating to storage adapters (fixes unhandled false fall-through from upload_exists? in with blocks)
  • Bump version from 0.1.0 to 0.2.0

Test plan

  • All 13 tests pass (unit + plug + OCI conformance suite)
  • mix compile --warnings-as-errors clean
  • Verify any downstream consumers handle the new map detail format

🤖 Generated with Claude Code

coryodaniel and others added 2 commits April 1, 2026 09:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant