|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Correct error handling in DALI've been struggling over the past weeks to get rid of my old VB6 habits of using error handling everywhere and I think I'm catching up quite fast! I have a question though... I have read many Best Practices topics about error handling and I trie not to create derived Exception errors to have Application specifics error since the framework covers a great deal of possible exceptions that may occur. So here is my question: I have a DAL class library with a class that uses Enterprise Libraries Data app blocks. In one of the methods I have defined in there, one is executing a stored procedure that returns a list of rows which I store in a dataset. Then, I want to check in the dataset if there are tables in it, which would tell me that data have actually been returned. Now, I have tried to have the SP return nothing which makes my DataSet tables count to 1 but this table has 0 rows. What I want to do is, in the case that no tables OR an empty table would be returned, I'd like to throw an exception which would be handled in my client's try catch but I do not want to use this: throw new Exception(...) since using Exception, ApplicationException or Systemexception is not recommended... What would be the best way to handle this situation? Maybe I am complicating myself? All I want is to raise some kind of notification without having to have if statements that checks for a flag old vb6-style. If my question isn't quite clear, feel free to ask for more precisions! Thanks a lot in advance! Regards, BigStef |
|||||||||||||||||||||||