Improve embedded tracker

Now it conforms to BEPs more closely.
This commit is contained in:
Chocobo1
2019-08-08 23:21:07 +08:00
parent 94f7a095bb
commit 8d0d8e4dcb
10 changed files with 423 additions and 230 deletions

View File

@@ -33,7 +33,7 @@
class HTTPError : public RuntimeError
{
public:
HTTPError(int statusCode, const QString &statusText, const QString &message = "");
HTTPError(int statusCode, const QString &statusText, const QString &message = {});
int statusCode() const;
QString statusText() const;
@@ -46,41 +46,47 @@ private:
class BadRequestHTTPError : public HTTPError
{
public:
explicit BadRequestHTTPError(const QString &message = "");
};
class ForbiddenHTTPError : public HTTPError
{
public:
explicit ForbiddenHTTPError(const QString &message = "");
};
class NotFoundHTTPError : public HTTPError
{
public:
explicit NotFoundHTTPError(const QString &message = "");
};
class ConflictHTTPError : public HTTPError
{
public:
explicit ConflictHTTPError(const QString &message = "");
};
class UnsupportedMediaTypeHTTPError : public HTTPError
{
public:
explicit UnsupportedMediaTypeHTTPError(const QString &message = "");
explicit BadRequestHTTPError(const QString &message = {});
};
class UnauthorizedHTTPError : public HTTPError
{
public:
explicit UnauthorizedHTTPError(const QString &message = "");
explicit UnauthorizedHTTPError(const QString &message = {});
};
class ForbiddenHTTPError : public HTTPError
{
public:
explicit ForbiddenHTTPError(const QString &message = {});
};
class NotFoundHTTPError : public HTTPError
{
public:
explicit NotFoundHTTPError(const QString &message = {});
};
class MethodNotAllowedHTTPError : public HTTPError
{
public:
explicit MethodNotAllowedHTTPError(const QString &message = {});
};
class ConflictHTTPError : public HTTPError
{
public:
explicit ConflictHTTPError(const QString &message = {});
};
class UnsupportedMediaTypeHTTPError : public HTTPError
{
public:
explicit UnsupportedMediaTypeHTTPError(const QString &message = {});
};
class InternalServerErrorHTTPError : public HTTPError
{
public:
explicit InternalServerErrorHTTPError(const QString &message = "");
explicit InternalServerErrorHTTPError(const QString &message = {});
};