123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #ifndef MYSQLX_COMMON_ERROR_H
- #define MYSQLX_COMMON_ERROR_H
- #include <string>
- #include <stdexcept>
- #include <ostream>
- #include <memory>
- #include <forward_list>
- #include <string.h> // for memcpy
- #include <utility> // std::move etc
- namespace mysqlx {
- namespace common {
- class Error : public std::runtime_error
- {
- public:
- Error(const char *msg)
- : std::runtime_error(msg)
- {}
- };
- inline
- std::ostream& operator<<(std::ostream &out, const Error &e)
- {
- out << e.what();
- return out;
- }
- inline
- void throw_error(const char *msg)
- {
- throw Error(msg);
- }
- }
- }
- #endif
|