catch dbi.program-error ?

  • Thread starter Brian Herbert Withun
  • Start date
B

Brian Herbert Withun

I'm having difficulty catching dbi.program-error which occurs this way:

import dbi, odbc
[...]
self.__cur.execute(sql)
dbi.program-error: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table 'depfile' not found in EXEC

but

try:
self.__cur.execute(sql)
except dbi.program-error,e:
print " caught "
raise

causes


What, in general, is the offender here? The hyphen in
"dbi.program-error" or the dot?
 
B

Brian Herbert Withun

try:
self.__cur.execute(sql)
except dbi.program-error,e:
print " caught "
raise


should be changed to:

try:
self.__cur.execute(sql)
except dbi.progError,e:
print " caught "
raise

In my infinite googling I found some source code that showed the actual
name of this exception class. I can't explain why it reports the
exception as "dbi.program-error" when left unhandled...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top