473,411 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

catch dbi.program-error ?

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
except dbi.program-error, e:
AttributeError: 'module' object has no attribute 'program'

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

Nov 22 '05 #1
2 2308
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...

Nov 22 '05 #2
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...

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jacek Dziedzic | last post by:
Hi! In my main() function I have a last-resort exception construct that looks like this: int main() { try { // ... program code }
4
by: nrhayyal | last post by:
hi all, i am facing a problem in catching an exception which is uncaught in any of the catch block. not doing so will gives me coredump. I tried by rewriting set_unexpected() and set_terminate()...
2
by: Rahul | last post by:
Hi, I have a little program as follows : =================== STARTS HERE ================ #include <stdio.h> void f (unsigned long); int main() {
5
by: Simon Johnson | last post by:
Recently, a thread appeared which asked how to create a "catch all" method for when an exception occurs within a program. The solution given only works for Windows Forms applications, as far as i...
5
by: PasalicZaharije | last post by:
Hallo, few days ago I see ctor like this: Ctor() try : v1(0) { // some code } catch(...) { // some code }
23
by: pigeonrandle | last post by:
Hi, Does this bit of code represent complete overkill?! try { //create a treenode TreeNode tn = new TreeNode(); //add it to a treeview tv.Nodes.Add(tn);
24
by: Chameleon | last post by:
Is there a possibility to create memory leak, the code below if I run the line: --------------------------------------------------------- MyClass cl = new MyClass();...
5
by: stevewilliams2004 | last post by:
I was wondering if someone could explain the output I am getting for the program below. What I expected from the main program output was "Cat" but instead I see "Mammal". The output is also...
5
by: vmnvmcxbv | last post by:
Why does this: try { throw 1; } catch(...) { handle_exception(); }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.