fastcgi++
exceptions.hpp
Go to the documentation of this file.
1 
2 /***************************************************************************
3 * Copyright (C) 2007 Eddie Carle [eddie@erctech.org] *
4 * *
5 * This file is part of fastcgi++. *
6 * *
7 * fastcgi++ is free software: you can redistribute it and/or modify it *
8 * under the terms of the GNU Lesser General Public License as published *
9 * by the Free Software Foundation, either version 3 of the License, or (at *
10 * your option) any later version. *
11 * *
12 * fastcgi++ is distributed in the hope that it will be useful, but WITHOUT *
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public *
15 * License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public License *
18 * along with fastcgi++. If not, see <http://www.gnu.org/licenses/>. *
19 ****************************************************************************/
20 
21 
22 #ifndef EXCEPTIONS_HPP
23 #define EXCEPTIONS_HPP
24 
25 #include <exception>
26 
28 namespace Fastcgipp
29 {
31  namespace Exceptions
32  {
36  struct CodedException: public std::exception
37  {
41  const int erno;
45  const char* msg;
50  CodedException(const char* msg_, const int erno_): erno(erno_), msg(msg_) {}
51  const char* what() const throw() { return msg; }
52  };
53 
57  struct CodeCvt: public std::exception
58  {
59  const char* what() const throw() { return "Code Conversion error"; }
60  };
61  }
62 }
63 
64 #endif