Skip to content

feat(errors): use thiserror for improved error handling#122

Open
shivv23 wants to merge 5 commits intoc2siorg:mainfrom
shivv23:feat/error-handling-improvements
Open

feat(errors): use thiserror for improved error handling#122
shivv23 wants to merge 5 commits intoc2siorg:mainfrom
shivv23:feat/error-handling-improvements

Conversation

@shivv23
Copy link
Copy Markdown

@shivv23 shivv23 commented Mar 22, 2026

Summary

Refactor CloudError to use thiserror derive macro for cleaner error handling.

Changes

  • Add thiserror dependency
  • Replace manual Error trait implementation with derive macro
  • Add helper constructors rate_limit() and rate_limit_after()
  • Add #[error] attribute messages for cleaner error output
  • Update AWS, GCP modules to use CloudError consistently

Why

  • thiserror generates less boilerplate
  • Cleaner error messages with attribute-based formatting
  • Consistent error handling across providers

Validation

  • cargo clippy --lib --all-features -- -D warnings passes

Dependencies

Requires #124 to be merged first (establishes lib.rs structure).

shivv23 added 5 commits March 22, 2026 20:05
…arnings

- Add lib.rs as canonical module export surface
- Simplify main.rs to minimal binary entrypoint
- Remove invalid Cargo.toml entries (dev-dependency loop, language block)
- Export token_provider module in traits
- Fix private module visibility for aws_dns and aws_loadbalancer
- Remove unused LlmStreamEvent import in vertex.rs
- Add PartialEq derive to ModelRef enum
- Fix test imports and assertions for dns/lb operations
- Replace manual Error implementation with thiserror derive macro
- Simplify CloudError enum with cleaner attribute-based error messages
- Add helper constructors rate_limit() and rate_limit_after()
- Maintain backward compatibility with existing Error trait impl
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