Reputation: 304524
So I'm going in and adding TAF (cluster failover) processing to some database code, and I'm winding up with similar chunks of code that look like this:
try:
... some database code...
except cx_Oracle.DatabaseError,e:
# ORA-25401: can not continue fetches
# ORA-25402: transaction must roll back
# ORA-25408: can not safely replay call
if e.message.code in (25401,25402,25408):
print 'node going down, restarting transaction...'
conn.rollback()
continue
else:
raise(e)
update: it turns out the answers are No and No.
Upvotes: 1
Views: 1004
Reputation: 36807
Sure you can, on Oracle linux/unix installations you can use oerr
utility. On windows there are some alternatives (1, 2) -not sure if they are the same- .
References:
Upvotes: 0
Reputation:
did you check http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/errors.htm ? there is a list of predefined exception that you can use. Next to that you can define user exceptions that tie a logical name to an error code.
Grouping of the errors is AFAIK not possible.
I hope this helps, Ronald
Upvotes: 1
Reputation: 60902
To translate Oracle error codes one by one, try http://www.ora-code.com/ or http://www.dba-oracle.com/oracle_news/2004_11_10_easy_lookup_error_codes.htm
Upvotes: 0