forked from soutade/libgourou
Manage ACSM files that contains server internal error
This commit is contained in:
parent
ab5afa5003
commit
fc839e671a
|
@ -64,7 +64,8 @@ namespace gourou
|
|||
FF_INVALID_ACSM_FILE,
|
||||
FF_NO_HMAC_IN_ACSM_FILE,
|
||||
FF_NOT_ACTIVATED,
|
||||
FF_NO_OPERATOR_URL
|
||||
FF_NO_OPERATOR_URL,
|
||||
FF_SERVER_INTERNAL_ERROR
|
||||
};
|
||||
|
||||
enum DOWNLOAD_ERROR {
|
||||
|
|
|
@ -505,6 +505,13 @@ namespace gourou
|
|||
if (!acsmDoc.load_file(ACSMFile.c_str(), pugi::parse_ws_pcdata_single|pugi::parse_escapes, pugi::encoding_utf8))
|
||||
EXCEPTION(FF_INVALID_ACSM_FILE, "Invalid ACSM file " << ACSMFile);
|
||||
|
||||
// Could be an server internal error
|
||||
pugi::xml_node rootNode = acsmDoc.first_child();
|
||||
if (std::string(rootNode.name()) == "error")
|
||||
{
|
||||
EXCEPTION(FF_SERVER_INTERNAL_ERROR, rootNode.attribute("data").value());
|
||||
}
|
||||
|
||||
GOUROU_LOG(INFO, "Fulfill " << ACSMFile);
|
||||
|
||||
// Build req file
|
||||
|
@ -512,7 +519,7 @@ namespace gourou
|
|||
|
||||
buildFulfillRequest(acsmDoc, fulfillReq);
|
||||
pugi::xpath_node root = fulfillReq.select_node("//adept:fulfill");
|
||||
pugi::xml_node rootNode = root.node();
|
||||
rootNode = root.node();
|
||||
|
||||
// Remove HMAC
|
||||
pugi::xpath_node xpathRes = fulfillReq.select_node("//hmac");
|
||||
|
|
Loading…
Reference in New Issue
Block a user