You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, any error (caused by wrong user input or lacking internet connection) is raised as a Python Exception, including a printed message with the line number and other technical detail. This is the expected behavior when using the module from Python, but not when using it as a tool from the command line. Thus, when running main() from the if __name__ == "__main__"-clause, exceptions should be caught from outside the main()-call and printed as a string containing only the error message. In some cases, such as failing web requests, it might even be useful to let main() raise a custom, more explanatory exception than the obligatory exception provided by the python requests-library.
The text was updated successfully, but these errors were encountered:
Currently, any error (caused by wrong user input or lacking internet connection) is raised as a Python Exception, including a printed message with the line number and other technical detail. This is the expected behavior when using the module from Python, but not when using it as a tool from the command line. Thus, when running
main()
from theif __name__ == "__main__"
-clause, exceptions should be caught from outside themain()
-call and printed as a string containing only the error message. In some cases, such as failing web requests, it might even be useful to letmain()
raise a custom, more explanatory exception than the obligatory exception provided by the python requests-library.The text was updated successfully, but these errors were encountered: