TL;DR: Don't cascade your exceptions Problems Readability Complexity Solutions Rewrite the nested clauses Context In the same way arrow code is hard to read, handling exceptions is a usual case when we must address the topics in a cascade way....

Markdown supported · ⌘↵ to post
Amazing!
Love this kind of comments. It was a refactoring mistake due to the lack of tests. And nobody noticed it before.
Fixed. Thank you so much!
Gary McMeekin
Full Stack Cloud Developer
I really enjoy these posts. Thank you for taking the time to do this work.
An understandable refactoring error, but in the problem code you only save if the file doesn't exist, but in the refactored code you left in the negation, meaning if the file doesn't exist you raise a File Exists exception.
I'll delete myself if I've read that wrong :).