Menu

[r607]: / framework / trunk / cppcms_error.h  Maximize  Restore  History

Download this file

26 lines (20 with data), 492 Bytes

 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
#ifndef _HTTP_ERROR_H
#define _HTTP_ERROR_H
#include <string>
#include <stdexcept>
#include <string.h>
namespace cppcms {
class cppcms_error : public std::runtime_error {
std::string strerror(int err)
{
char buf[256];
strerror_r(err,buf,sizeof(buf));
return buf;
}
public:
cppcms_error(int err,std::string const &error):
std::runtime_error(error+":" + strerror(err)) {};
cppcms_error(std::string const &error) : std::runtime_error(error) {};
};
}
#endif /* _HTTP_ERROR_H */
MongoDB Logo MongoDB