except.hxx

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/except.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of libpqxx exception classes
00008  *   pqxx::sql_error, pqxx::broken_connection, pqxx::in_doubt_error, ...
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/except instead.
00010  *
00011  * Copyright (c) 2003-2006, Jeroen T. Vermeulen <jtv@xs4all.nl>
00012  *
00013  * See COPYING for copyright license.  If you did not receive a file called
00014  * COPYING with this source code, please notify the distributor of this mistake,
00015  * or contact the author.
00016  *
00017  *-------------------------------------------------------------------------
00018  */
00019 #include "pqxx/compiler-public.hxx"
00020 #include "pqxx/compiler-internal-pre.hxx"
00021 
00022 #include <stdexcept>
00023 
00024 #include "pqxx/util"
00025 
00026 
00027 namespace pqxx
00028 {
00029 
00046 
00047 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error
00048 {
00049 public:
00050   broken_connection();
00051   explicit broken_connection(const PGSTD::string &);
00052 };
00053 
00054 
00056 
00057 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error
00058 {
00059   PGSTD::string m_Q;
00060 
00061 public:
00062   sql_error();
00063   explicit sql_error(const PGSTD::string &);
00064   sql_error(const PGSTD::string &, const PGSTD::string &Q);
00065   virtual ~sql_error() throw ();
00066 
00068   const PGSTD::string &query() const throw ();                          //[t56]
00069 };
00070 
00071 
00072 // TODO: should this be called statement_completion_unknown!?
00074 
00080 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
00081 {
00082 public:
00083   explicit in_doubt_error(const PGSTD::string &);
00084 };
00085 
00086 
00088 class PQXX_LIBEXPORT internal_error : public PGSTD::logic_error
00089 {
00090 public:
00091   explicit internal_error(const PGSTD::string &);
00092 };
00093 
00094 
00096 class PQXX_LIBEXPORT feature_not_supported : public sql_error
00097 {
00098 public:
00099   explicit feature_not_supported(const PGSTD::string &err) : sql_error(err) {}
00100   feature_not_supported(const PGSTD::string &err, const PGSTD::string &Q) :
00101         sql_error(err,Q) {}
00102 };
00103 
00105 class PQXX_LIBEXPORT data_exception : public sql_error
00106 {
00107 public:
00108   explicit data_exception(const PGSTD::string &err) : sql_error(err) {}
00109   data_exception(const PGSTD::string &err, const PGSTD::string &Q) :
00110         sql_error(err,Q) {}
00111 };
00112 
00113 class PQXX_LIBEXPORT integrity_constraint_violation : public sql_error
00114 {
00115 public:
00116   explicit integrity_constraint_violation(const PGSTD::string &err) :
00117         sql_error(err) {}
00118   integrity_constraint_violation(const PGSTD::string &err,
00119         const PGSTD::string &Q) :
00120         sql_error(err, Q) {}
00121 };
00122 
00123 
00124 class PQXX_LIBEXPORT invalid_cursor_state : public sql_error
00125 {
00126 public:
00127   explicit invalid_cursor_state(const PGSTD::string &err) : sql_error(err) {}
00128   invalid_cursor_state(const PGSTD::string &err, const PGSTD::string &Q) :
00129         sql_error(err,Q) {}
00130 };
00131 
00132 class PQXX_LIBEXPORT invalid_sql_statement_name : public sql_error
00133 {
00134 public:
00135   explicit invalid_sql_statement_name(const PGSTD::string &err) :
00136         sql_error(err) {}
00137   invalid_sql_statement_name(const PGSTD::string &err, const PGSTD::string &Q) :
00138         sql_error(err,Q) {}
00139 };
00140 
00141 class PQXX_LIBEXPORT invalid_cursor_name : public sql_error
00142 {
00143 public:
00144   explicit invalid_cursor_name(const PGSTD::string &err) : sql_error(err) {}
00145   invalid_cursor_name(const PGSTD::string &err, const PGSTD::string &Q) :
00146         sql_error(err,Q) {}
00147 };
00148 
00149 class PQXX_LIBEXPORT syntax_error : public sql_error
00150 {
00151 public:
00152   explicit syntax_error(const PGSTD::string &err) : sql_error(err) {}
00153   syntax_error(const PGSTD::string &err, const PGSTD::string &Q) :
00154         sql_error(err,Q) {}
00155 };
00156 
00157 class PQXX_LIBEXPORT undefined_table : public syntax_error
00158 {
00159 public:
00160   explicit undefined_table(const PGSTD::string &err) : syntax_error(err) {}
00161   undefined_table(const PGSTD::string &err, const PGSTD::string &Q) :
00162     syntax_error(err, Q) {}
00163 };
00164 
00165 class PQXX_LIBEXPORT insufficient_privilege : public sql_error
00166 {
00167 public:
00168   explicit insufficient_privilege(const PGSTD::string &err) : sql_error(err) {}
00169   insufficient_privilege(const PGSTD::string &err, const PGSTD::string &Q) :
00170         sql_error(err,Q) {}
00171 };
00172 
00174 class PQXX_LIBEXPORT insufficient_resources : public sql_error
00175 {
00176 public:
00177   explicit insufficient_resources(const PGSTD::string &err) : sql_error(err) {}
00178   insufficient_resources(const PGSTD::string &err, const PGSTD::string &Q) :
00179         sql_error(err,Q) {}
00180 };
00181 
00182 class PQXX_LIBEXPORT disk_full : public insufficient_resources
00183 {
00184 public:
00185   explicit disk_full(const PGSTD::string &err) : insufficient_resources(err) {}
00186   disk_full(const PGSTD::string &err, const PGSTD::string &Q) :
00187         insufficient_resources(err,Q) {}
00188 };
00189 
00190 class PQXX_LIBEXPORT out_of_memory : public insufficient_resources
00191 {
00192 public:
00193   explicit out_of_memory(const PGSTD::string &err) :
00194         insufficient_resources(err) {}
00195   out_of_memory(const PGSTD::string &err, const PGSTD::string &Q) :
00196         insufficient_resources(err,Q) {}
00197 };
00198 
00199 class PQXX_LIBEXPORT too_many_connections : public broken_connection
00200 {
00201 public:
00202   explicit too_many_connections(const PGSTD::string &err) :
00203         broken_connection(err) {}
00204 };
00205 
00210 }
00211 
00212 #include "pqxx/compiler-internal-post.hxx"

Generated on Wed Sep 6 16:54:12 2006 for libpqxx by  doxygen 1.4.7