1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/ErrorMessage.cpp

27 lines
558 B
C++
Raw Normal View History

2013-02-02 17:32:54 -05:00
#include "ErrorMessage.h"
#include "JsonSerializer.h"
ErrorMessage::ErrorMessage(QString message, QObject *parent) : QObject(parent) {
m_message = message;
}
ErrorMessage::ErrorMessage(QString type, QString message, QObject *parent) : QObject(parent) {
m_type = type;
m_message = message;
}
QByteArray ErrorMessage::toString() {
JsonSerializer serializer;
QVariantMap map;
if (m_type.isNull())
2013-05-21 07:58:46 -04:00
map["class"] = "InvalidResponseError";
2013-02-02 17:32:54 -05:00
else
2013-05-21 07:58:46 -04:00
map["class"] = m_type;
2013-02-02 17:32:54 -05:00
map["message"] = m_message;
return serializer.serialize(map);
}