diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2010-09-05 18:12:39 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2010-09-05 18:12:39 +0200 |
commit | 73a0556dca6ff98da2a77a34e75c5eec5969cd87 (patch) | |
tree | 5f092a4074192f4031d33cc50bc7142ea11fc14f /include | |
parent | 9a717577d06f00bb8a0c7338f7b687540b5e017d (diff) | |
download | sqlitexx-73a0556dca6ff98da2a77a34e75c5eec5969cd87.tar.gz sqlitexx-73a0556dca6ff98da2a77a34e75c5eec5969cd87.tar.bz2 |
revised exception hierarchy, following more the pqxx ideas
Diffstat (limited to 'include')
-rw-r--r-- | include/sqlite3xx/except.hpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/include/sqlite3xx/except.hpp b/include/sqlite3xx/except.hpp index 2577e85..6a70216 100644 --- a/include/sqlite3xx/except.hpp +++ b/include/sqlite3xx/except.hpp @@ -32,20 +32,40 @@ using namespace std; namespace sqlite3xx { -class SQLITEXX_LIBEXPORT sql_error : runtime_error { - string _m; - string _q; +class SQLITEXX_LIBEXPORT sqlitexx_exception { + public: + virtual ~sqlitexx_exception( ) throw( ) = 0; + + virtual exception &base( ) throw( ) = 0; +}; + +class SQLITEXX_LIBEXPORT failure : public sqlitexx_exception, public runtime_error +{ + virtual exception &base( ) throw( ) { return *this; } + + public: + explicit failure( const string &s ); +}; + +class SQLITEXX_LIBEXPORT sql_error : public failure { + string m_q; public: sql_error( ); - explicit sql_error( string& q ); - explicit sql_error( string& __m, string& q ); + explicit sql_error( const string& _q ); + explicit sql_error( const string& _m, const string& _q ); virtual ~sql_error( ) throw( ); const string& msg( ) const throw( ); const string& query( ) const throw( ); }; +/* +class SQLITEXX_LIBEXPORT db_locked : sql_error { + public: + explicit db_locket( string &q ); +}; +*/ } #endif /* SQLITE3XX_EXCEPT_H */ |