2011-09-09 22:40:59 +04:00
|
|
|
#ifndef exception_hh_INCLUDED
|
|
|
|
#define exception_hh_INCLUDED
|
|
|
|
|
2012-04-14 05:17:09 +04:00
|
|
|
#include "string.hh"
|
2011-09-09 22:40:59 +04:00
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
struct exception
|
|
|
|
{
|
2017-01-09 01:30:15 +03:00
|
|
|
virtual ~exception() = default;
|
2015-03-13 16:15:51 +03:00
|
|
|
virtual StringView what() const;
|
2011-09-09 22:40:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct runtime_error : exception
|
|
|
|
{
|
2013-04-11 15:57:35 +04:00
|
|
|
runtime_error(String what)
|
|
|
|
: m_what(std::move(what)) {}
|
2011-09-09 22:40:59 +04:00
|
|
|
|
2015-03-25 16:34:00 +03:00
|
|
|
StringView what() const override { return m_what; }
|
2011-09-09 22:40:59 +04:00
|
|
|
|
|
|
|
private:
|
2013-04-11 15:57:35 +04:00
|
|
|
String m_what;
|
2011-09-09 22:40:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct logic_error : exception
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // exception_hh_INCLUDED
|