Try/Catch Blocks

Overusing try/catch blocks makes a program unwieldy and obscures the actual control flow. Try/catch blocks should be reserved for code that depends on unpredictable external factors such as user input, network calls, file system access, or…

1 sources - 3 claims

Overusing try/catch blocks makes a program unwieldy and obscures the actual control flow. Try/catch blocks should be reserved for code that depends on unpredictable external factors such as user input, network calls, file system access, or other external resources where failure is a realistic possibility. Try/catch blocks should not be placed around every line of code.