fcbond / ltdb

Linguistic Type Data-Base
Other
2 stars 2 forks source link

Error handling #28

Open fcbond opened 2 years ago

fcbond commented 2 years ago

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.

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.

Thanks to @goodmami for the comment