-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuerror.cpp
More file actions
46 lines (38 loc) · 786 Bytes
/
Copy pathuerror.cpp
File metadata and controls
46 lines (38 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <QDebug>
#include "uview.h"
#include "uerror.h"
uError::uError(QObject *parent) :
uController(parent),
m_error(), m_code(0)
{
}
uError::uError(const QString &error, const int code, QObject *parent) :
uController(parent), m_error(error), m_code(code)
{
}
void uError::indexAction()
{
if (m_response->mimeType().startsWith("text/html"))
{
uView view(":/error.tpl");
view.insert("error", m_error);
m_response->setBody(view.fetch());
}
else {
m_response->setBody(m_error);
}
m_response->render();
}
void uError::setError(const QString &error, const int code)
{
m_error = error;
m_code = code;
}
QString uError::error() const
{
return m_error;
}
int uError::code() const
{
return m_code;
}