|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
try catch stuffhey all,
i know i need a try catch in my method but do i put all the contents of my method withing the try catch or should I just put some of the code? thanks, ari >i know i need a try catch in my method but do i put all the contents of my It depends on the purpose of catching the exception. Why do you need>method withing the try catch or should I just put some of the code? the Try Catch block to begin with? Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. if you need all code in the try statement ?? this depends on the code my
initial feeling would say include only the strict necessary code in it only use try catch blocks if you really need to do so try catch blocks have a lot of overhead and so make your program a lot slower it is better coding practice to check for yourself if possible regards Michel Posseth [MCP] Show quoteHide quote "ari" <a**@discussions.microsoft.com> schreef in bericht news:424D4A2A-C894-4596-9738-B7B5887AD7CF@microsoft.com... > hey all, > > i know i need a try catch in my method but do i put all the contents of my > method withing the try catch or should I just put some of the code? > > > thanks, > ari thanks everyone.
Show quoteHide quote "ari" wrote: > hey all, > > i know i need a try catch in my method but do i put all the contents of my > method withing the try catch or should I just put some of the code? > > > thanks, > ari |
|||||||||||||||||||||||