fix(demo): don't crash generator if upstream isn't ready

This commit is contained in:
Łukasz Mierzwa
2019-04-22 23:38:33 +01:00
parent 809c6c6fab
commit e2ad914b74

View File

@@ -47,7 +47,10 @@ def jsonGetRequest(uri):
def jsonPostRequest(uri, data):
req = urllib2.Request(uri)
req.add_header("Content-Type", "application/json")
response = urllib2.urlopen(req, json.dumps(data))
try:
response = urllib2.urlopen(req, json.dumps(data))
except Exception as e:
print("Request to '%s' failed: %s" % (uri, e))
def addSilence(matchers, startsAt, endsAt, createdBy, comment):