Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Data::ODBC::StatementException is caught by DataException

Please post support and help requests here.

Poco::Data::ODBC::StatementException is caught by DataException

Postby DougE » 25 Aug 2008, 22:36

Hi,

I have code as follows:

try {
try {
SQL execute call
...
other processing
} catch (DataException dex) {
process it
}
} catch (Exception ex) {
process this differently
}

I mistyped my SQL statement and it threw a StatementException which is a typedef for a HandleException which is a sub-class of an ODBCException which is a sub-class of DataException. However, the HandleException gets caught by the Exception clause and NOT the DataException clause.

Can someone explain this to me?

It also seems wierd that with HandleExceptions I have to do a toString() call to get the text instead of message() like everything else. Am I missing something?

Thanks,
Doug
DougE
 
Posts: 13
Joined: 15 Jul 2008, 17:44

Re: Poco::Data::ODBC::StatementException is caught by DataException

Postby alex » 26 Aug 2008, 03:03

> Can someone explain this to me?

I tried it and indeed that is what happens. It will catch ODBCException, though. I'm not quite sure why. I'm on vacation as of tomorrow, so maybe someone else will be able to answer this.

> It also seems wierd that with HandleExceptions I have to do a toString() call to get the text instead of message() like everything else. Am I missing something?

Leftover from early days of Data lib design. It's been taken care of in SVN trunk.

Alex
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests