GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 private:
50  std::string url;
51  std::vector<gpudb::GenericRecord> records;
52 };
53 
54 
56 {
57 public:
58  GPUdbExitException( const std::string& messageParam) : GPUdbException( messageParam ) {}
59 
60  virtual const char* what() const throw() { return message.c_str(); }
61 
62  ~GPUdbExitException() throw() {}
63 };
64 
65 
67 {
68 public:
69  GPUdbHAUnavailableException( const std::string& messageParam) : GPUdbException( messageParam ) {}
70 
71  GPUdbHAUnavailableException( const std::string& message_,
72  const std::vector<HttpUrl>& urls_ );
73 
74  virtual const char* what() const throw() { return message.c_str(); }
75 
77 
78 
79 private:
80  std::vector<HttpUrl> urls;
81 };
82 
83 
85 {
86 public:
87  GPUdbSubmitException( const std::string& messageParam) : GPUdbException( messageParam ) {}
88 
89  GPUdbSubmitException( HttpUrl url_, const std::vector<uint8_t>& request_,
90  const std::string& message_);
91 
92  virtual const char* what() const throw() { return message.c_str(); }
93 
94  ~GPUdbSubmitException() throw() {}
95 
96 
97 private:
98  std::vector<uint8_t> request;
99  HttpUrl url;
100 };
101 
102 
103 }
104 
105 #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)
GPUdbSubmitException(const std::string &messageParam)
GPUdbHAUnavailableException(const std::string &messageParam)
virtual const char * what() const
virtual const char * what() const
GPUdbExitException(const std::string &messageParam)
virtual const char * what() const
virtual const char * what() const
GPUdbInsertionException(const std::string &messageParam)