starting work on websocket chat reader
This commit is contained in:
40
ircexception.cpp
Normal file
40
ircexception.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "ircexception.hpp"
|
||||
|
||||
IrcException::IrcException(QString _what)
|
||||
: _what(_what.toLocal8Bit())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char* IrcException::what() const noexcept
|
||||
{
|
||||
return _what.data();
|
||||
}
|
||||
|
||||
IrcTagNotFoundException::IrcTagNotFoundException(QString tag)
|
||||
: IrcException(QString("missing tag: %1").arg(tag)), tag(tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
IrcParseException::IrcParseException(QString message, QString description)
|
||||
: IrcException(_makeWhat(message, description)),
|
||||
message(message), description(description)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString IrcParseException::_makeWhat(QString message, QString description)
|
||||
{
|
||||
QString s = "";
|
||||
if (!message.isEmpty())
|
||||
s = QString("Description: %1\n").arg(description);
|
||||
return s + QString("Message: %1").arg(message);
|
||||
}
|
||||
|
||||
IrcIncorrectTypeException::IrcIncorrectTypeException(IrcMessageType expected, IrcMessageType actual)
|
||||
: IrcException(QString("Expected: %1 Actual: %2").arg(expected.toString(), actual.toString())),
|
||||
expected(expected), actual(actual)
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user