c# - Is there a way to automatically determine the possible exceptions a statement could throw? -
is there methodology -- , if so, -- finding out exceptions may thrown particular statement?
e.g., given following code:
string substr = selectedfilename.substring(date_begin_pos, date_length); return datetime.parse(substr); ...how know exception[s] might thrown second line? think 1 highlight line, , select context menu supply this/these...
as far i'm aware there isn't way of finding out other looking on msdn: http://msdn.microsoft.com/en-us/library/1k1skd40.aspx
the easy/lazy/c# way of doing "catch (exception e)" , deal generic exception type. have of information need in type exceptions anyway. exception handling should used logging/promoting, imho knowing datetime.parse can throw either formatexception or arguementnullexception pointless (to me).
Comments
Post a Comment