Skip to content

Commit

Permalink
Print error and recover if VOEvent message has no ivorn
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Feb 28, 2014
1 parent db6701c commit 96250d6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions gcn/voeventclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,16 @@ def _ingest_packet(sock, ivorn, handler, log):
log.error("received transport message with unrecognized role: %s", root.attrib["role"])
elif root.tag in ("{http://www.ivoa.net/xml/VOEvent/v1.1}VOEvent", "{http://www.ivoa.net/xml/VOEvent/v2.0}VOEvent"):
log.info("received VOEvent")
_send_packet(sock, _form_response("ack", root.attrib["ivorn"], ivorn, _get_now_iso8601()))
log.debug("sent receipt response")
if handler is not None:
try:
handler(payload, root)
except:
log.exception("exception in payload handler")
if 'ivorn' not in root.attrib:
log.error("received voevent message without ivorn")
else:
_send_packet(sock, _form_response("ack", root.attrib["ivorn"], ivorn, _get_now_iso8601()))
log.debug("sent receipt response")
if handler is not None:
try:
handler(payload, root)
except:
log.exception("exception in payload handler")
else:
log.error("received XML document with unrecognized root tag: %s", root.tag)

Expand Down

0 comments on commit 96250d6

Please sign in to comment.