How come OracleException for all Exceptions?

How come OracleException for all Exceptions?

Postby kevinherring » Mon 26 Mar 2007 11:47

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
kevinherring
 
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Postby Alexey » Tue 27 Mar 2007 07:14

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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby kevinherring » Thu 29 Mar 2007 13:09

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.
kevinherring
 
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Postby Alexey » Mon 02 Apr 2007 08:05

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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby kevinherring » Mon 02 Apr 2007 08:23

yes, that is exactly what I am saying.
kevinherring
 
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Postby Alexey » Mon 02 Apr 2007 08:33

OK, we will take note of your suggestions.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby kevinherring » Mon 02 Apr 2007 08:33

Thanks Alexey
kevinherring
 
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Postby Alexey » Mon 02 Apr 2007 08:55

You are welcome.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle