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
{{ message }}
Repository navigation
[I-001] [Tech Debt]: Remove all unwrap() calls from production code #357
Priority: High Phase: Phase 1 (Code Quality) Dependencies: None
📝 User Story
As a developer / operator,
I want to eliminate every unwrap() in production paths,
So that the CMS never panics unexpectedly in production and returns meaningful errors instead.
🎯 Scope & Requirements
Replace unwrap() in main.rs (lines 7, 15, 18) with proper error propagation (? operator or graceful exit with eprintln!)
Replace unwrap() in auth_middleware.rs (lines 28, 73) with ? returning an appropriate UNAUTHORIZED response
Replace unwrap() in rest_api_routes.rs (line 64) with map_err or filter_map
Replace unwrap() in workflow_dispatcher.rs (IP parse calls, lines 284-295) with compile-time validated constants or expect() with justification
Replace unwrap() in login_page.rs (line 79) with user-facing error handling
Replace unwrap() in workflow.rs domain entity serde calls (lines 66-108) with proper error propagation
✅ Acceptance Criteria
Given the full src/ tree, Whengrep -rn 'unwrap()' src/ is run, Then zero results are returned (or all remaining uses have // SAFETY: justification).
Given an invalid CORS origin in .env, When the server starts, Then a descriptive error is logged instead of a panic.
Given a malformed Authorization header, When a request hits the auth middleware, Then a 401 JSON error is returned without a panic.
Activity
check_auth/check_customer_auth) #360indpurvesh commentedon Oct 24, 2026
done