status-desktop/src-cpp/backend/types.cpp

25 lines
560 B
C++
Raw Normal View History

2022-01-06 19:29:19 +00:00
#include "backend/types.h"
#include <QString>
using namespace std;
ostream& operator<<(ostream& os, const Backend::RpcError& r)
{
return (os << "RpcError(\n code: " << r.m_code << "\n message: " << r.m_message.toStdString() << "\n)"
<< std::endl);
2022-01-06 19:29:19 +00:00
}
Backend::RpcError::RpcError(double code, QString message):
m_code(code),
m_message(message)
{}
2022-01-06 19:29:19 +00:00
Backend::RpcException::RpcException(const std::string& message)
: m_message(message)
2022-01-06 19:29:19 +00:00
{ }
const char* Backend::RpcException::what() const throw()
{
return m_message.c_str();
}