qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
httpexception.h
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 <QException>
9#include <QNetworkReply>
10
11
12#ifndef HTTPEXCEPTION_H
13#define HTTPEXCEPTION_H
14
15namespace qTbot {
16
20class HttpException: public QException
21{
22public:
28 HttpException(QNetworkReply::NetworkError code, const QByteArray& erroString = {});
29
30 // exception interface
31public:
36 const char *what() const noexcept override;
37
38 // QException interface
39public:
43 void raise() const override;
44
49 QException *clone() const override;
50
55 QNetworkReply::NetworkError code() const;
56
57private:
58 QByteArray _errText;
59 QNetworkReply::NetworkError _code;
60};
61}
62#endif // HTTPEXCEPTION_H
QException * clone() const override
clone Creates a copy of the exception.
const char * what() const noexcept override
what Returns the text description of the error.
void raise() const override
raise Raises the exception.
HttpException(QNetworkReply::NetworkError code, const QByteArray &erroString={})
HttpException constructs the exception with an http error code and an error description.
QNetworkReply::NetworkError code() const
code Returns the network error code.