Skip to content

Instantly share code, notes, and snippets.

@echohack
Last active December 14, 2015 03:29
Show Gist options
  • Save echohack/5021057 to your computer and use it in GitHub Desktop.
Save echohack/5021057 to your computer and use it in GitHub Desktop.
import socket
import requests
# ...snippet
def call_api(url):
try:
requests.get(url="url")
except:
socket.error as e:
print("Could not open socket: {0}".format(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment