GPUdb C++ API  Version 7.2.2.4
GPUdbException.hpp
Go to the documentation of this file.
1 #ifndef __GPUDB__GPUDBEXCEPTION_HPP__
2 #define __GPUDB__GPUDBEXCEPTION_HPP__
3 
5 #include "gpudb/Http.hpp"
6 
7 #include <exception>
8 #include <string>
9 #include <vector>
10 
11 
12 namespace gpudb
13 {
14 /*
15  * Generic exceptions thrown by the C++ GPUdb client API.
16  */
17 class GPUdbException : public std::exception
18 {
19 public:
20  GPUdbException(const std::string& messageParam) : message( messageParam ) {}
21 
22  virtual const char* what() const throw() { return message.c_str(); }
23 
24  ~GPUdbException() throw() {}
25 
26 protected:
27  std::string message;
28 };
29 
30 
31 
33 {
34 public:
35  GPUdbInsertionException( const std::string& messageParam) : GPUdbException( messageParam ) {}
36 
37  GPUdbInsertionException( const std::string& url_,
38  const std::vector<gpudb::GenericRecord>& records_,
39  const std::string& message_ );
40 
41  virtual const char* what() const throw() { return message.c_str(); }
42 
44 
45  // Insert additional records into this exception object's record queue
46  void append_records( std::vector<gpudb::GenericRecord>::iterator begin,
47  std::vector<gpudb::GenericRecord>::iterator end );
48 
49  std::vector<gpudb::GenericRecord> getRecords() const { return records; }
50 
51 private:
52  std::string url;
53  std::vector<gpudb::GenericRecord> records;
54 };
55 
56 
58 {
59 public:
60  GPUdbExitException( const std::string& messageParam) : GPUdbException( messageParam ) {}
61 
62  virtual const char* what() const throw() { return message.c_str(); }
63 
64  ~GPUdbExitException() throw() {}
65 };
66 
67 
69 {
70 public:
71  GPUdbHAUnavailableException( const std::string& messageParam) : GPUdbException( messageParam ) {}
72 
73  GPUdbHAUnavailableException( const std::string& message_,
74  const std::vector<HttpUrl>& urls_ );
75 
76  virtual const char* what() const throw() { return message.c_str(); }
77 
79 
80 
81 private:
82  std::vector<HttpUrl> urls;
83 };
84 
85 
87 {
88 public:
89  GPUdbSubmitException( const std::string& messageParam) : GPUdbException( messageParam ) {}
90 
91  GPUdbSubmitException( HttpUrl url_, const std::vector<uint8_t>& request_,
92  const std::string& message_);
93 
94  virtual const char* what() const throw() { return message.c_str(); }
95 
96  ~GPUdbSubmitException() throw() {}
97 
98 
99 private:
100  std::vector<uint8_t> request;
101  HttpUrl url;
102 };
103 
104 
105 }
106 
107 #endif
virtual const char * what() const
void append_records(std::vector< gpudb::GenericRecord >::iterator begin, std::vector< gpudb::GenericRecord >::iterator end)
GPUdbException(const std::string &messageParam)
virtual const char * what() const
GPUdbSubmitException(const std::string &messageParam)
GPUdbHAUnavailableException(const std::string &messageParam)
GPUdbExitException(const std::string &messageParam)
std::vector< gpudb::GenericRecord > getRecords() const
virtual const char * what() const
virtual const char * what() const
virtual const char * what() const
GPUdbInsertionException(const std::string &messageParam)