I am not sure where the best location to handle my exceptions in my DAL class. I have some code that does a read, and populates a list of business objects like the pseudo-code below:
public List<MyObject> GetMyObjects()
{
while (dataReader.Read()
{
try
{
//populate business object
}
catch
{
//log exception?
}
}
}
The question I have is that I'm not sure if my logging class should be in this class, but throwing an exception isn't acceptable since it will cause the code to exit this method. What have the rest of you done in this situation?
NOTE: Per our business rules, the objects that cannot be loaded properly just need to be logged (this is due to some issues we are resolving in the database at the same time this code is being refactored).