qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
httpexception.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2023-2026 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
8
#include "
httpexception.h
"
9
10
namespace
qTbot
{
11
12
HttpException::HttpException
(QNetworkReply::NetworkError
code
,
13
const
QByteArray &erroString) {
14
15
_code =
code
;
16
17
if
(erroString.size()) {
18
_errText = erroString;
19
}
else
{
20
21
_errText = QByteArray(
"Http request finished with code: "
).
22
append(QString::number(
code
).toLatin1());
23
}
24
}
25
26
const
char
*
HttpException::what
() const noexcept {
27
return
_errText.constData();
28
}
29
30
void
HttpException::raise
()
const
{
31
throw
*
this
;
32
}
33
34
QException *
HttpException::clone
()
const
{
35
return
new
HttpException
(QNetworkReply::NetworkError(0),
36
_errText);
37
}
38
39
QNetworkReply::NetworkError
HttpException::code
()
const
{
40
return
_code;
41
}
42
}
qTbot::HttpException::clone
QException * clone() const override
clone Creates a copy of the exception.
Definition
httpexception.cpp:34
qTbot::HttpException::what
const char * what() const noexcept override
what Returns the text description of the error.
Definition
httpexception.cpp:26
qTbot::HttpException::raise
void raise() const override
raise Raises the exception.
Definition
httpexception.cpp:30
qTbot::HttpException::HttpException
HttpException(QNetworkReply::NetworkError code, const QByteArray &erroString={})
HttpException constructs the exception with an http error code and an error description.
Definition
httpexception.cpp:12
qTbot::HttpException::code
QNetworkReply::NetworkError code() const
code Returns the network error code.
Definition
httpexception.cpp:39
httpexception.h
qTbot
Definition
telegramdeletemessage.cpp:8
src
qTbot
src
public
qTbot
httpexception.cpp
Generated by
1.18.0