Try Catch Finally 🔄
Try blocks are like transactions.
Your catch has to leave your program in a consistent state, no matter what happens in the try.
For this reason it is good practice to start with a try-catch-finally statement when you are writing code that could throw exceptions.
This helps you define what the user of that code should expect, no matter what goes wrong with the code that is executed in the try .
#CleanCode #Exceptions
Try blocks are like transactions.
Your catch has to leave your program in a consistent state, no matter what happens in the try.
For this reason it is good practice to start with a try-catch-finally statement when you are writing code that could throw exceptions.
This helps you define what the user of that code should expect, no matter what goes wrong with the code that is executed in the try .
#CleanCode #Exceptions