Unify custom exceptions

This commit is contained in:
Vladimir Golovnev (Glassez)
2021-05-05 16:41:30 +03:00
parent 89cedd411e
commit 9565b695ef
13 changed files with 43 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2018 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2018, 2021 Vladimir Golovnev <glassez@yandex.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,12 +28,20 @@
#pragma once
#include <stdexcept>
#include <QString>
class RuntimeError : public std::runtime_error
class Exception
{
public:
explicit RuntimeError(const QString &message = {});
QString message() const;
explicit Exception(const QString &message = {}) noexcept;
[[nodiscard]] QString message() const noexcept;
private:
QString m_message;
};
class RuntimeError : public Exception
{
public:
using Exception::Exception;
};