Advertisement
Jexal

9a58992b-4ef5-4b10-9587-67ac0a5c6057

Jan 26th, 2025
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import logging
  2.  
  3. # Configure logging settings
  4. logging.basicConfig(filename='error.log',
  5.                     level=logging.ERROR,
  6.                     format='%(asctime)s - %(levelname)s - %(message)s')
  7.  
  8. try:
  9.     # Code that may raise an error
  10.     raise Exception("Wayback Link Saver ran into some issues: "
  11.                     "HTTPConnectionPool(host='web.archive.org', port=80): "
  12.                     "Max retries exceeded with url: /save/https://www.youtube.com/watch?v=bjSe-0vSRMY "
  13.                     "(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000028A0CF3BE80>: "
  14.                     "Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))")
  15. except Exception as e:
  16.     # Log the error
  17.     logging.error(e)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement