Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No Overload takes 5 arguments
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01583574
Message ID:
01583795
Vues:
29
>>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 :-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform