libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
IQuentierException.h
1/*
2 * Copyright 2016-2021 Dmitry Ivanov
3 *
4 * This file is part of libquentier
5 *
6 * libquentier is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, version 3 of the License.
9 *
10 * libquentier is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LIB_QUENTIER_EXCEPTION_I_QUENTIER_EXCEPTION_H
20#define LIB_QUENTIER_EXCEPTION_I_QUENTIER_EXCEPTION_H
21
22#include <quentier/types/ErrorString.h>
23#include <quentier/utility/Printable.h>
24
25#include <QException>
26
27namespace quentier {
28
37class QUENTIER_EXPORT IQuentierException : public Printable, public QException
38{
39public:
40 ~IQuentierException() noexcept override;
41
42 [[nodiscard]] ErrorString errorMessage() const;
43 [[nodiscard]] QString localizedErrorMessage() const;
44 [[nodiscard]] QString nonLocalizedErrorMessage() const;
45
46 [[nodiscard]] const char * what() const noexcept override;
47
48 QTextStream & print(QTextStream & strm) const override;
49
50protected:
53 IQuentierException & operator=(const IQuentierException & other);
54
55 [[nodiscard]] virtual QString exceptionDisplayName() const = 0;
56
57private:
58 ErrorString m_message;
59 char * m_whatMessage = nullptr;
60};
61
62} // namespace quentier
63
64#endif // LIB_QUENTIER_EXCEPTION_I_QUENTIER_EXCEPTION_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:43
The IQuentierException class represents the interface for exceptions specific to libquentier and appl...
Definition IQuentierException.h:38
The Printable class is the interface for Quentier's internal classes which should be able to write th...
Definition Printable.h:38
The Result template class represents the bare bones result monad implementation which either contains...
Definition Result.h:38