GPUdb C++ API  Version 6.2.0.3
GPUdbException.hpp
Go to the documentation of this file.
1 #ifndef __GPUDB__GPUDBEXCEPTION_HPP__
2 #define __GPUDB__GPUDBEXCEPTION_HPP__
3 
5 
6 #include <exception>
7 #include <string>
8 #include <vector>
9 
10 
11 namespace gpudb
12 {
13  /*
14  * Generic exceptions thrown by the C++ GPUdb client API.
15  */
16  class GPUdbException : public std::exception
17  {
18  public:
19  GPUdbException(const std::string& message) : message(message) {}
20 
21  virtual const char* what() const throw() { return message.c_str(); }
22 
23  ~GPUdbException() throw() {}
24 
25  private:
26  std::string message;
27  };
28 
29 
30 
32  {
33  public:
34  GPUdbInsertionException( const std::string& message ) : GPUdbException( message ) {}
35 
36  GPUdbInsertionException( const std::string& url_,
37  const std::vector<gpudb::GenericRecord>& records_,
38  const std::string& message_ );
39 
40  virtual const char* what() const throw() { return message.c_str(); }
41 
43 
44  // Insert additional records into this exception object's record queue
45  void append_records( std::vector<gpudb::GenericRecord>::iterator begin,
46  std::vector<gpudb::GenericRecord>::iterator end );
47 
48  private:
49  std::string message;
50  std::string url;
51  std::vector<gpudb::GenericRecord> records;
52  };
53 
54 
55 }
56 
57 #endif
virtual const char * what() const
GPUdbException(const std::string &message)
GPUdbInsertionException(const std::string &message)
virtual const char * what() const