src/proto2/Error.hh
author terom
Thu, 20 Nov 2008 22:10:28 +0000
branchno-netsession
changeset 38 4189b8bf3a5b
parent 36 785d220fc6b7
permissions -rw-r--r--
kind of works
#ifndef ERROR_HH
#define ERROR_HH

#include <stdexcept>
#include <string>

class Error : public std::exception {
    private:
        const char *message;
    
    public:
        Error (const std::string &message) : message(message.c_str()) { }

        virtual const char* what() const throw() {
            return message;
        }
};

#endif /* ERROR_HH */