0

Hi all,

What are your thoughts about how many and which type of errors should be caught and handled within functions, especially roll-your-own utility functions?

For example: suppose I have a function that removes a directory and all subdirectories and files underneath it. Should that function test for path existence? OR, should it simply allow whatever exceptions to be raised if the caller fails to properly check?

The packaged modules in Python seem to do some of each, so I'm fuddled.

Thanks,
Jeff

2
Contributors
1
Reply
3
Views
10 Years
Discussion Span
Last Post by vegaseat
0

Removing a directory, all subdirectories and files seems to be a consequential operation, and I would error prove it to the hilt.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.