openapi-rust-sdk
openapi-rust-sdk copied to clipboard
Add SDK error type for custom error propagation
Fixes #11.
This change adds a public openapi_sdk::Error type and openapi_sdk::Result
Changes
- Added openapi_sdk::Error with variants for HTTP errors, invalid headers, and invalid HTTP methods.
- Implemented Display, std::error::Error, and From conversions for wrapped error types.
- Replaced panic-prone unwrap() calls for header and method parsing with returned SDK errors.
- Added error_for_status() handling for non-2xx HTTP responses.
- Added regression tests for custom error propagation.
- Documented custom error integration in README and crates.io docs.
Verification
- cargo fmt --all -- --check
- cargo test
- cargo test --examples