If I have a function something like:
def foo(.. ):
try:
#something
return_value = "bleh"
except Exception,e:
logging.error("exception " +e)
return return_value
Does the above look ok? I mean, if I got the exception then return_value is never initialized.
What's a good way to handle exceptions in a function that has some return value?
None, but that may have unintended consequences on the calling function.raise.