Reputation: 3274
I am using Enterprise Library's DAAB to access a database, both with ExecuteReader
and ExecuteNonQuery
. The problem is that these methods do not have exceptions thrown documented... How can I, then, know which exceptions should I catch?
Upvotes: 1
Views: 97
Reputation: 17101
I agree with WebTurner, I'm guessing a good place to start would be which database your connecting to, so if an ms sql database I'm guessing a couple of (perhaps many) exceptions would be:
http://msdn.microsoft.com/en-us/library/9kcbe65k.aspx
EDIT:
I just came across this: How can I determine which exceptions can be thrown by a given method?
Which looks liek it uses reflection to help uncover a list of exceptions that are thrown.
Upvotes: 2
Reputation: 7314
The problem is that there are many exceptions that will be thrown at a lower level than the enterprise library, and it would be impossible for EL to document all of these.
I suggest you use the exception handling and logging blocks to catch and log all exceptions. You can then see which ones occur and adapt the configuration of the exception handler or add new code to handle the specific execptions.
Upvotes: 1