You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 7444: Remove unwrap() from message, handler, and security modules
Replace .unwrap() calls in the message, handler, and security modules with proper error handling in preparation for enabling the unwrap_used clippy lint.
## Changes
- handler_factory.rs: Replace unwrap() with proper error propagation
- bulk_load.rs: Replace unwrap() with error handling for bulk load operations
- fedauth.rs: Replace unwrap() with safe alternative
- login.rs: Replace unwrap() with error propagation for login message construction
- security/mock.rs: Replace unwrap() with .expect() since this is test-only infrastructure
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup to replace panic-prone `unwrap()` calls with explicit error handling in security, message, and handler modules to support stricter Clippy lints.
#### PR Summary
This pull request eliminates `unwrap()` calls across security, message, and handler modules by replacing them with `expect()` calls containing descriptive error messages or proper error handling logic.
- `security/mock.rs`: Replaced all `unwrap()` calls with `expect()` containing context-specific error messages in tests and documentation examples
- `message/login.rs`: Added proper error handling for routing information to return `ProtocolError` instead of panicking when redirection target is missing
- `message/bulk_load.rs`: Replaced `unwrap()` with `ok_or_else()` to return `ImplementationError` when first row column count is unexpectedly missing
- `handler/handler_factory.rs`: Refactored to use `unwrap_or(false)` for database instance validation and `if let Some()` pattern for TDS error handling
- `message/features/fedauth.rs`: Changed `unwrap()` to `unwrap_or(i32::MAX)` for length conversion fallback
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #44826
0 commit comments