BadgerDB
 All Classes Namespaces Functions Variables Typedefs Friends Pages
badgerdb_exception.h
1 
8 #pragma once
9 
10 #include <exception>
11 #include <string>
12 
13 namespace badgerdb {
14 
18 class BadgerDbException : public std::exception {
19  public:
25  explicit BadgerDbException(const std::string& msg);
26 
31  virtual ~BadgerDbException() throw() {}
32 
38  virtual const std::string& message() const { return message_; }
39 
45  virtual const char* what() const throw() { return message_.c_str(); }
46 
54  friend std::ostream& operator<<(std::ostream& out,
55  const BadgerDbException& exception) {
56  out << exception.message();
57  return out;
58  }
59 
60  protected:
64  std::string message_;
65 };
66 
67 }
Base class for all BadgerDB-specific exceptions.
virtual const std::string & message() const
BadgerDbException(const std::string &msg)
friend std::ostream & operator<<(std::ostream &out, const BadgerDbException &exception)
virtual const char * what() const