Problem
tests/cache_integration_test.rs contains 30 panic-prone calls (unwrap, expect, or panic!).
Evidence
tests/cache_integration_test.rs:24 — .expect("Failed to init cache pool");
tests/cache_integration_test.rs:29 — let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
tests/cache_integration_test.rs:33 — .expect("Failed to init DB pool")
tests/cache_integration_test.rs:48 — .unwrap();
tests/cache_integration_test.rs:51 — let cached_rate = repo.get_current_rate("AFRI", "USD").await.unwrap();
Proposed fix
Replace non-essential unwrap/expect usages with typed error propagation and contextual logging. Keep explicit panics only where unrecoverable invariants are well-documented.
Acceptance criteria
- All avoidable panic-prone calls in this file are removed or justified with comments/tests.
- Error paths return typed errors and preserve observability context.
- Existing tests pass (or new tests cover changed paths).
Problem
tests/cache_integration_test.rscontains 30 panic-prone calls (unwrap,expect, orpanic!).Evidence
tests/cache_integration_test.rs:24—.expect("Failed to init cache pool");tests/cache_integration_test.rs:29—let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");tests/cache_integration_test.rs:33—.expect("Failed to init DB pool")tests/cache_integration_test.rs:48—.unwrap();tests/cache_integration_test.rs:51—let cached_rate = repo.get_current_rate("AFRI", "USD").await.unwrap();Proposed fix
Replace non-essential
unwrap/expectusages with typed error propagation and contextual logging. Keep explicit panics only where unrecoverable invariants are well-documented.Acceptance criteria