title: Which key failed in Python KeyError?
body: <p>If I catch a <code>KeyError</code>, how can I tell what lookup failed?</p>
  
  <pre><code>def poijson2xml(location_node, POI_JSON):
    try:
      man_json = POI_JSON["FastestMan"]
      woman_json = POI_JSON["FastestWoman"]
    except KeyError:
      # How can I tell what key ("FastestMan" or "FastestWoman") caused the error?
      LogErrorMessage ("POIJSON2XML", "Can't find mandatory key in JSON")
  </code></pre>