Page 1 of 1

How come OracleException for all Exceptions?

Posted: Mon 26 Mar 2007 11:47
by kevinherring
Hi -just a quick query/suggestion.

How come nearly all Exceptions that come back from Oracle are OracleExceptions, and not mapped to their own type? Obviously you can tell what sort of exception it is using the Code, but wouldnt it be better if you mapped each code to a specific Exception?

That way you could catch specific exceptions.

Just a thought
Thanks
Kevin

Posted: Tue 27 Mar 2007 07:14
by Alexey
If you received OracleException this means that Oracle server returned an error. Its code is in the field Code. The description of each code exists in Oracle documentation.

Posted: Thu 29 Mar 2007 13:09
by kevinherring
Yes I understand how it works, but what I am suggesting is the corelab drivers catch the exception thrown by the server and then throw an exception relevant to the error. Checking the error code is soooo VB6 :-)

Using a case statement on the error code also means that my catch block loses some of its structure.

Posted: Mon 02 Apr 2007 08:05
by Alexey
If I got you right you would like us to make some classes of exceptions and map server's errors to them. We do not think that checking the error code is VB6 style.

Posted: Mon 02 Apr 2007 08:23
by kevinherring
yes, that is exactly what I am saying.

Posted: Mon 02 Apr 2007 08:33
by Alexey
OK, we will take note of your suggestions.

Posted: Mon 02 Apr 2007 08:33
by kevinherring
Thanks Alexey

Posted: Mon 02 Apr 2007 08:55
by Alexey
You are welcome.