Mercurial > hg > piper-cpp
comparison vamp-server/convert.cpp @ 174:59c89b0e9375
Fix regression from old schema changes, regarding assessing whether a JSON response was successful
| author | Lucas Thompson <dev@lucas.im> |
|---|---|
| date | Tue, 31 Jan 2017 22:47:12 +0000 |
| parents | 0876b5e67afe |
| children | 60dc013bd69c |
comparison
equal
deleted
inserted
replaced
| 173:492970caa62b | 174:59c89b0e9375 |
|---|---|
| 293 rr.id = readJsonId(j); | 293 rr.id = readJsonId(j); |
| 294 | 294 |
| 295 VampJson::BufferSerialisation serialisation = | 295 VampJson::BufferSerialisation serialisation = |
| 296 VampJson::BufferSerialisation::Array; | 296 VampJson::BufferSerialisation::Array; |
| 297 | 297 |
| 298 rr.success = j["success"].bool_value(); | 298 const bool isSuccess = j["result"].is_object(); |
| 299 rr.errorText = j["errorText"].string_value(); | 299 const bool isError = j["error"].is_object(); |
| 300 rr.success = isSuccess; | |
| 301 rr.errorText = isError ? j["error"]["message"].string_value() : ""; | |
| 300 | 302 |
| 301 switch (rr.type) { | 303 switch (rr.type) { |
| 302 | 304 |
| 303 case RRType::List: | 305 case RRType::List: |
| 304 rr.listResponse = VampJson::toRpcResponse_List(j, err); | 306 rr.listResponse = VampJson::toRpcResponse_List(j, err); |
