This block of code can fail in many ways that are not at all related to data corruption (decode, from_binary, inside the do_diffobj_put).  Consider actually logging the error/reason pair to disambiguate or separating the code. Don't be afraid of logging too much: Lager has a throttle already, data corruption is as serious as it can get and we'll be the ones begging for this information in 6 months while debugging something completely unrelated, in ways you didn't think of today :)