Code Smell 184 - Exception Arrow Code
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....
maximilianocontieri.com2 min read
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 :).