The code below describes a small invoice preview service. After a recent change, the behavior started to diverge from what is expected: some errors no longer reach the calling code, and the service state changes even when the operation ultimately fails.
after.cargo test
ERR appears in the line item string.build_preview must return an error, not a successful partial result.template|line1,line2,....1.85.02021cargo testsrc/lib.rsPreviewCache.fail_writesUse line comments to explain the problem, its impact, the fix and how to test it.