summaryrefslogtreecommitdiffabout
path: root/include/kingate/exception.h
blob: 85d89ea054d072eacc2f71e8d22f553aca508a1e (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __KINGATE_EXCEPTION_H
#define __KINGATE_EXCEPTION_H

#include <stdexcept>
#include <konforka/exception.h>

/**
 * @file
 * @brief The kingate-specific exceptions.
 */

/**
 * @brief the main kingate namespace.
 */
namespace kingate {
    using namespace std;

    /**
     * The base for kingate-specific exception.
     */
    class exception : public konforka::exception {
	public:
	    explicit exception(const string& w)
		: konforka::exception(NOCODEPOINT,w) { }
	    exception(const string& fi,const string& fu,int l,const string &w)
		: konforka::exception(fi,fu,l,w) { }
    };

    /**
     * Thrown if the specified variable or parameter wasn't found.
     */
    class exception_notfound : public exception {
	public:
	    explicit exception_notfound(const string& w)
		: exception(w) { }
	    exception_notfound(const string& fi,const string& fu,int l,const string& w)
		: exception(fi,fu,l,w) { }
    };

    /**
     * Thrown in case of unexpected server behaviour.
     */
    class server_error : public exception {
	public:
	    server_error(const string& fi,const string& fu,int l,const string& w)
		: exception(fi,fu,l,w) { }
    };
}

#endif /* __KINGATE_EXCEPTION_H */
/*
 * vim:set ft=cpp:
 */