summaryrefslogtreecommitdiff
path: root/src/exception.hh
blob: 89188e6388563d1d83f2db705d4a9a4568d3751c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef exception_hh_INCLUDED
#define exception_hh_INCLUDED

#include <string>

namespace Kakoune
{

struct exception
{
    virtual ~exception() {}
    virtual std::string description() const;
};

struct runtime_error : exception
{
    runtime_error(const std::string& description)
        : m_description(description) {}

    std::string description() const { return m_description; }

private:
    std::string m_description;
};

struct logic_error : exception
{
};

}

#endif // exception_hh_INCLUDED