瀏覽代碼

Merge pull request #8682 from rpastrana/HPCC-15577-DESDLFalsePositive

HPCC-15577 ESDLConfig getESDLBinding report failures

Reviewed-By: Kevin Wang <kevin.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 年之前
父節點
當前提交
ba3fefd72b
共有 1 個文件被更改,包括 23 次插入2 次删除
  1. 23 2
      esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp

+ 23 - 2
esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp

@@ -1171,15 +1171,36 @@ void fetchESDLDefinitionFromDaliById(const char *id, StringBuffer & def)
     IPropertyTree * deftree = esdlDefinitions->getPropTree(xpath);
     if(deftree)
         toXML(deftree, def, 0,0);
+    else
+        throw MakeStringException(-1, "Unable to fetch ESDL Service definition from dali: '%s'", id);
 }
 
 bool CWsESDLConfigEx::onGetESDLDefinition(IEspContext &context, IEspGetESDLDefinitionRequest&req, IEspGetESDLDefinitionResponse &resp)
 {
     StringBuffer id = req.getId();
     StringBuffer definition;
-    fetchESDLDefinitionFromDaliById(id.toLowerCase(), definition);
-
     resp.setId(id.str());
+
+    try
+    {
+        fetchESDLDefinitionFromDaliById(id.toLowerCase(), definition);
+    }
+    catch(IException* e)
+    {
+        StringBuffer msg;
+        e->errorMessage(msg);
+
+        resp.updateStatus().setCode(-1);
+        resp.updateStatus().setDescription(msg.str());
+
+        e->Release();
+        return false;
+    }
+    catch (...)
+    {
+        throw MakeStringException(-1, "Unexpected error while attempting to fetch ESDL definition.");
+    }
+
     resp.setXMLDefinition(definition.str());
 
     return true;