General information
Category:
Coding, syntax and commands
Environment versions
Network:
Windows 2008 Server
>>I think the catch comment is probably badly worded. If the exception could truly be handled then re-throwing would be unnecessary. If it's only partially handled (eg logging or notifying the user) but is not recoverable then throwing to a higher level makes sense....
>
>But wouldn't you end up logging the error twice (assuming you have an error handler in the method above the one that had an exception, which you should, right?)
Yes. Maybe logging wasn't a good example. But sometimes there is more information available for logging when the initial exception is thrown (local values, etc.) - the alternative is to create a custom exception to retain those values and throw that. The latter is probably more 'correct' - but more work :-}
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only