aboutsummaryrefslogtreecommitdiff
path: root/exc.h
blob: 491ec23456ea955b6ad2dc0b80fccc5614b5e82a (plain) (blame)
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
#ifndef EXC_H
#define EXC_H

#include "consts.h"
#include <string>

using std::string;

/** @class GeneralError
 * The top-level exception
 */
class GeneralError {
    protected:
        string msg;                     /**< Error mesg */
        ErrCode code;                   /**< Error code */
    public:

        GeneralError(ErrCode code);         /**< Construct a General Error */ 
        string get_msg();                   /**< Get the error message */
};

/** @class TokenError
 * Error with some hints
 */
class TokenError : public GeneralError {
    public:
        /** Construct an TokenError */
        TokenError(string token, ErrCode code);     
};

/** @class NormalError
 * Error with constant plain text 
 */
class NormalError : public GeneralError {
    public:
        /** Construct a NormalError */
        NormalError(ErrCode code);
};

#endif