I am printing the exception e (which is otherwise unused here), but ideally I should catch only exceptions that you expect and can handle.
Finally, it's good practice to only put the statements that can trigger the exception (generally just one line) inside the "try" block, so you don't mix up exceptions from different calls.
Blanket exceptions hide the true problems.
I am printing the exception e (which is otherwise unused here), but ideally I should catch only exceptions that you expect and can handle.
Thanks to @goodmami for the comment