summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2010-09-05 18:12:39 +0200
committerAndreas Baumann <abaumann@yahoo.com>2010-09-05 18:12:39 +0200
commit73a0556dca6ff98da2a77a34e75c5eec5969cd87 (patch)
tree5f092a4074192f4031d33cc50bc7142ea11fc14f /src
parent9a717577d06f00bb8a0c7338f7b687540b5e017d (diff)
downloadsqlitexx-73a0556dca6ff98da2a77a34e75c5eec5969cd87.tar.gz
sqlitexx-73a0556dca6ff98da2a77a34e75c5eec5969cd87.tar.bz2
revised exception hierarchy, following more the pqxx ideas
Diffstat (limited to 'src')
-rw-r--r--src/except.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/except.cpp b/src/except.cpp
index cda8c7f..5ae357d 100644
--- a/src/except.cpp
+++ b/src/except.cpp
@@ -20,33 +20,35 @@
namespace sqlite3xx {
-sql_error::sql_error( ) :
- runtime_error( "failed query" ),
- _m( ),
- _q( ) {
+sqlitexx_exception::~sqlitexx_exception( ) throw( )
+{
}
-sql_error::sql_error( string& __m ) :
- runtime_error( __m ),
- _m( __m ),
- _q( ) {
+failure::failure( const string &_what )
+ : sqlitexx_exception( ), runtime_error( _what )
+{
}
-sql_error::sql_error( string& __m, string& q ) :
- runtime_error( __m ),
- _m( __m ),
- _q( q ) {
+sql_error::sql_error( )
+ : failure( "failed query" ), m_q( )
+{
}
-sql_error::~sql_error( ) throw( ){
+sql_error::sql_error( const string &_what )
+ : failure( _what ), m_q( )
+{
+}
+
+sql_error::sql_error( const string &_what, const string &_q )
+ : failure( _what ), m_q( _q )
+{
}
-const string& sql_error::msg( ) const throw( ) {
- return _m;
+sql_error::~sql_error( ) throw( ){
}
const string& sql_error::query( ) const throw( ) {
- return _q;
+ return m_q;
}
} /* namespace sqlite3xx */