Yet Another HTTP Library
yahttp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
exception.hpp
Go to the documentation of this file.
1 #ifndef _YAHTTP_EXCEPTION_HPP
2 #define _YAHTTP_EXCEPTION_HPP 1
3 
4 #include <exception>
5 
6 namespace YaHTTP {
8  class Error: public std::exception {
9  public:
10  Error() {};
11  Error(const std::string& reason): reason(reason) {};
12  virtual ~Error() throw() {};
13 
14  virtual const char* what() const throw()
15  {
16  return reason.c_str();
17  }
18  const std::string reason; //<! Cause of the error
19  };
21  class ParseError: public YaHTTP::Error {
22  public:
23  ParseError() {};
24  ParseError(const std::string& reason): Error(reason) {};
25  };
26 };
27 
28 #endif
ParseError()
Definition: exception.hpp:23
Definition: exception.hpp:8
virtual ~Error()
Definition: exception.hpp:12
virtual const char * what() const
Definition: exception.hpp:14
Error()
Definition: exception.hpp:10
Definition: exception.hpp:21
ParseError(const std::string &reason)
Definition: exception.hpp:24
const std::string reason
Definition: exception.hpp:18
Error(const std::string &reason)
Definition: exception.hpp:11