2016-06-11 19:09:14 +02:00
|
|
|
#ifndef APPLICATION_UTILITIES_FAILURE_H
|
|
|
|
#define APPLICATION_UTILITIES_FAILURE_H
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2016-08-29 15:35:48 +02:00
|
|
|
#include "../global.h"
|
2015-04-22 18:36:40 +02:00
|
|
|
|
|
|
|
#include <exception>
|
2017-09-29 17:14:57 +02:00
|
|
|
#include <iosfwd>
|
2015-04-22 18:36:40 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace ApplicationUtilities {
|
|
|
|
|
2017-05-01 03:13:11 +02:00
|
|
|
class CPP_UTILITIES_EXPORT Failure : public std::exception {
|
2015-04-22 18:36:40 +02:00
|
|
|
public:
|
|
|
|
Failure();
|
|
|
|
Failure(const std::string &what);
|
2018-03-11 22:39:01 +01:00
|
|
|
~Failure() noexcept;
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2018-03-11 22:39:01 +01:00
|
|
|
virtual const char *what() const noexcept;
|
2015-04-22 18:36:40 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_what;
|
|
|
|
};
|
2017-09-29 17:14:57 +02:00
|
|
|
|
2017-10-07 23:02:29 +02:00
|
|
|
CPP_UTILITIES_EXPORT std::ostream &operator<<(std::ostream &o, const Failure &failure);
|
2017-09-29 17:14:57 +02:00
|
|
|
|
2017-09-17 21:45:23 +02:00
|
|
|
} // namespace ApplicationUtilities
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2016-06-11 19:09:14 +02:00
|
|
|
#endif // APPLICATION_UTILITIES_FAILURE_H
|