From 73a0556dca6ff98da2a77a34e75c5eec5969cd87 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 5 Sep 2010 18:12:39 +0200 Subject: revised exception hierarchy, following more the pqxx ideas --- src/except.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3-54-g00ecf