Why can't I catch the following error?

Hi and welcome to the forum :wave:

Please consider wrapping your code and terminal output in backticks (as described here: Please read: make it easier to help you ) for easier readability :slight_smile:

Regarding your actual problem:

  • What exactly is your desired output? If I understand correctly, your code should print "Broken Pipe Error - Ignored" if you encounter the error you mentioned, but keep running? What is the behavior you see instead? (exception/no exception; exact error message)
  • I think your code as-is should probably throw an UndefVarError if the HTTP error occurs because your catch block inside main() doesn’t assign the variable e. Are there some parts of the code missing?
1 Like