I was wondering how you guys handle functions fails. Do you raise an exception, or do you return an error message?
e.G. I have a function that is supposed to connect to an external com-object. If the com-object has not been initiated through another program, the connection cannot be established. What would be the preferred python way of notifying the main program? Should I raise an exception with the detailed error message, or should I simple return the error message?
Thanks!
python absolutely comes down on the side of exceptions here. i have always found this article to be a great explanation.