]> git.tdb.fi Git - libs/core.git/blob - source/core/systemerror.h
Add a constructor for system_error that takes error message instead of code
[libs/core.git] / source / core / systemerror.h
1 #ifndef MSP_CORE_SYSTEMERROR_H_
2 #define MSP_CORE_SYSTEMERROR_H_
3
4 #include <stdexcept>
5 #include <string>
6
7 namespace Msp {
8
9 class system_error: public std::runtime_error
10 {
11 private:
12         int code_;
13
14 public:
15         system_error(const std::string &, int = -1);
16         system_error(const std::string &, const std::string &);
17         virtual ~system_error() throw() { }
18
19         int code() const throw() { return code_; }
20
21 private:
22         static std::string get_message(int);
23 };
24
25 } // namespace Msp
26
27 #endif