# 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
    00065 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error
    00066 {
    00067 public:
    00068   broken_connection();
    00069   explicit broken_connection(const PGSTD::string &);
    00070 };
    00071
    00072
    00074
    00075 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error
    00076 {
    00077   PGSTD::string m_Q;
    00078
    00079 public:
    00080   sql_error();
    00081   explicit sql_error(const PGSTD::string &);
    00082   sql_error(const PGSTD::string &, const PGSTD::string &Q);
    00083   virtual ~sql_error() throw ();
    00084
    00086   const PGSTD::string &query() const throw ();                          //[t56]
    00087 };
    00088
    00089
    00090 // TODO: should this be called statement_completion_unknown!?
    00092
    00098 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
    00099 {
    00100 public:
    00101   explicit in_doubt_error(const PGSTD::string &);
    00102 };
    00103
    00104
    00106 class PQXX_LIBEXPORT internal_error : public PGSTD::logic_error
    00107 {
    00108 public:
    00109   explicit internal_error(const PGSTD::string &);
    00110 };
    00111
    00112
    00114 class PQXX_LIBEXPORT feature_not_supported : public sql_error
    00115 {
    00116 public:
    00117   explicit feature_not_supported(const PGSTD::string &err) : sql_error(err) {}
    00118   feature_not_supported(const PGSTD::string &err, const PGSTD::string &Q) :
    00119         sql_error(err,Q) {}
    00120 };
    00121
    00123 class PQXX_LIBEXPORT data_exception : public sql_error
    00124 {
    00125 public:
    00126   explicit data_exception(const PGSTD::string &err) : sql_error(err) {}
    00127   data_exception(const PGSTD::string &err, const PGSTD::string &Q) :
    00128         sql_error(err,Q) {}
    00129 };
    00130
    00131 class PQXX_LIBEXPORT integrity_constraint_violation : public sql_error
    00132 {
    00133 public:
    00134   explicit integrity_constraint_violation(const PGSTD::string &err) :
    00135         sql_error(err) {}
    00136   integrity_constraint_violation(const PGSTD::string &err,
    00137         const PGSTD::string &Q) :
    00138         sql_error(err, Q) {}
    00139 };
    00140
    00141
    00142 class PQXX_LIBEXPORT invalid_cursor_state : public sql_error
    00143 {
    00144 public:
    00145   explicit invalid_cursor_state(const PGSTD::string &err) : sql_error(err) {}
    00146   invalid_cursor_state(const PGSTD::string &err, const PGSTD::string &Q) :
    00147         sql_error(err,Q) {}
    00148 };
    00149
    00150 class PQXX_LIBEXPORT invalid_sql_statement_name : public sql_error
    00151 {
    00152 public:
    00153   explicit invalid_sql_statement_name(const PGSTD::string &err) :
    00154         sql_error(err) {}
    00155   invalid_sql_statement_name(const PGSTD::string &err, const PGSTD::string &Q) :
    00156         sql_error(err,Q) {}
    00157 };
    00158
    00159 class PQXX_LIBEXPORT invalid_cursor_name : public sql_error
    00160 {
    00161 public:
    00162   explicit invalid_cursor_name(const PGSTD::string &err) : sql_error(err) {}
    00163   invalid_cursor_name(const PGSTD::string &err, const PGSTD::string &Q) :
    00164         sql_error(err,Q) {}
    00165 };
    00166
    00167 class PQXX_LIBEXPORT syntax_error : public sql_error
    00168 {
    00169 public:
    00170   explicit syntax_error(const PGSTD::string &err) : sql_error(err) {}
    00171   syntax_error(const PGSTD::string &err, const PGSTD::string &Q) :
    00172         sql_error(err,Q) {}
    00173 };
    00174
    00175 class PQXX_LIBEXPORT undefined_column : public syntax_error
    00176 {
    00177 public:
    00178   explicit undefined_column(const PGSTD::string &err) : syntax_error(err) {}
    00179   undefined_column(const PGSTD::string &err, const PGSTD::string &Q) :
    00180     syntax_error(err, Q) {}
    00181 };
    00182
    00183 class PQXX_LIBEXPORT undefined_function : public syntax_error
    00184 {
    00185 public:
    00186   explicit undefined_function(const PGSTD::string &err) : syntax_error(err) {}
    00187   undefined_function(const PGSTD::string &err, const PGSTD::string &Q) :
    00188     syntax_error(err, Q) {}
    00189 };
    00190
    00191 class PQXX_LIBEXPORT undefined_table : public syntax_error
    00192 {
    00193 public:
    00194   explicit undefined_table(const PGSTD::string &err) : syntax_error(err) {}
    00195   undefined_table(const PGSTD::string &err, const PGSTD::string &Q) :
    00196     syntax_error(err, Q) {}
    00197 };
    00198
    00199 class PQXX_LIBEXPORT insufficient_privilege : public sql_error
    00200 {
    00201 public:
    00202   explicit insufficient_privilege(const PGSTD::string &err) : sql_error(err) {}
    00203   insufficient_privilege(const PGSTD::string &err, const PGSTD::string &Q) :
    00204         sql_error(err,Q) {}
    00205 };
    00206
    00208 class PQXX_LIBEXPORT insufficient_resources : public sql_error
    00209 {
    00210 public:
    00211   explicit insufficient_resources(const PGSTD::string &err) : sql_error(err) {}
    00212   insufficient_resources(const PGSTD::string &err, const PGSTD::string &Q) :
    00213         sql_error(err,Q) {}
    00214 };
    00215
    00216 class PQXX_LIBEXPORT disk_full : public insufficient_resources
    00217 {
    00218 public:
    00219   explicit disk_full(const PGSTD::string &err) : insufficient_resources(err) {}
    00220   disk_full(const PGSTD::string &err, const PGSTD::string &Q) :
    00221         insufficient_resources(err,Q) {}
    00222 };
    00223
    00224 class PQXX_LIBEXPORT out_of_memory : public insufficient_resources
    00225 {
    00226 public:
    00227   explicit out_of_memory(const PGSTD::string &err) :
    00228         insufficient_resources(err) {}
    00229   out_of_memory(const PGSTD::string &err, const PGSTD::string &Q) :
    00230         insufficient_resources(err,Q) {}
    00231 };
    00232
    00233 class PQXX_LIBEXPORT too_many_connections : public broken_connection
    00234 {
    00235 public:
    00236   explicit too_many_connections(const PGSTD::string &err) :
    00237         broken_connection(err) {}
    00238 };
    00239
    00244 }
    00245
    00246 #include "pqxx/compiler-internal-post.hxx"