# HG changeset patch # User Chris Cannam # Date 1472032240 -3600 # Node ID 62c17e143abaa1a33f88f4b72b41991329a346dd # Parent 91f5c92d3bf7ac426d7b67cdde1b7803e5c40431 Simple test script (and associated fixes) for the JS code diff -r 91f5c92d3bf7 -r 62c17e143aba json/VampJson.h --- a/json/VampJson.h Tue Aug 23 12:04:49 2016 +0100 +++ b/json/VampJson.h Wed Aug 24 10:50:40 2016 +0100 @@ -983,16 +983,19 @@ fromException(const std::exception &e, RRType responseType) { json11::Json::object jo; + std::string type; - if (responseType == RRType::List) jo["type"] = "list"; - else if (responseType == RRType::Load) jo["type"] = "load"; - else if (responseType == RRType::Configure) jo["type"] = "configure"; - else if (responseType == RRType::Process) jo["type"] = "process"; - else if (responseType == RRType::Finish) jo["type"] = "finish"; - else jo["type"] = "invalid"; + if (responseType == RRType::List) type = "list"; + else if (responseType == RRType::Load) type = "load"; + else if (responseType == RRType::Configure) type = "configure"; + else if (responseType == RRType::Process) type = "process"; + else if (responseType == RRType::Finish) type = "finish"; + else type = "invalid"; + jo["type"] = type; jo["success"] = false; - jo["errorText"] = std::string("exception caught: ") + e.what(); + jo["errorText"] = std::string("exception caught: ") + + type + " request: " + e.what(); return json11::Json(jo); }