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