-1
Utilise Try...Catch
influence on performance? in memory usage?
Would be a problem if all actions you do have error handling?
try
{
clienteRepository.Salvar(entity);
}
catch (Exception e)
{
emailService.EnviaErro(e);
}
-1
Utilise Try...Catch
influence on performance? in memory usage?
Would be a problem if all actions you do have error handling?
try
{
clienteRepository.Salvar(entity);
}
catch (Exception e)
{
emailService.EnviaErro(e);
}
-1
Yes, it has minimal runtime influence, unless you make large loops inside the Ry, use only when necessary and avoid using the Exception, use the exception according to the type of error expected to happen, example opening a connection with a bd use Sqlexception.
And regarding performance you prefer performance or avoid a crash?
Browser other questions tagged c# asp.net-mvc-5 exception
You are not signed in. Login or sign up in order to post.
@bfavaretto is not duplicate, I think the edition you made became clearer
– Rod
Exactly Caffé, my idea would be in exception, send me email with the mistake that happened, rs
– Rod
A suggestion: when developing web applications, worry about system design and data traffic cost, not with micro-optimization-prior-dubious code performance.
– Caffé
Thank you Caffé, taking advantage of your suggestion, some tool for me to analyze the traffic of the application ?
– Rod
Now considering the added code: doesn’t seem like a good idea, Rod. Not for performance reasons but for design reasons - this example uses exceptions to define application flow. Exceptions are not for this.
– Caffé
To moderators, the question is not duplicated, in fact, what is wrong is the question of the cited link, and in the answer of the quoted link ends up answering my question, but the question itself is not duplicated.
– Rod
I agree, Rod: the answer to that question answers yours and the questions are different.
– Caffé
Rod and @Caffé As the answer there meets, the orientation is to close as duplicate (even though the questions are not identical).
– bfavaretto