| 1 |
#include "ResponseError.h" |
| 2 |
|
| 3 |
LSP::ResponseError::ResponseError() {} |
| 4 |
|
| 5 |
LSP::ResponseError::ResponseError(const wxString& message) |
| 6 |
{ |
| 7 |
JSON json(message); |
| 8 |
FromJSON(json.toElement()); |
| 9 |
} |
| 10 |
|
| 11 |
LSP::ResponseError::~ResponseError() {} |
| 12 |
|
| 13 |
void LSP::ResponseError::FromJSON(const JSONItem& json) |
| 14 |
{ |
| 15 |
if(json.hasNamedObject("error")) { |
| 16 |
// serialize the parent |
| 17 |
this->Message::FromJSON(json); |
| 18 |
|
| 19 |
// extract the error message |
| 20 |
JSONItem error = json.namedObject("error"); |
| 21 |
// an error message |
| 22 |
m_errorCode = error.namedObject("code").toInt(); |
| 23 |
m_message = error.namedObject("message").toString(); |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
std::string LSP::ResponseError::ToString() const { return ""; } |
| 28 |
|
| 29 |
JSONItem LSP::ResponseError::ToJSON(const wxString& name) const { return JSONItem(nullptr); } |