Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an object back?
Message
De
27/02/2013 12:54:57
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01566475
Message ID:
01567058
Vues:
60
This message has been marked as a message which has helped to the initial question of the thread.
That's not the way it works here. There is no generic error handler like in VFP. Throw will send the error up one level in the error handling hierarchy. There are a couple of ways to deal with errors.

- Add a try/catch in the main program to catch everything that is thrown. But I don't recommend this. Ideally, you should handle the error as close to where it happens as possible and only handle errors that have a real possbility of occuring. In otherwords, specific errors are taken care of where they occur.

- Use third party software that logs unhandled errors. For MVC, I'm using Elmah.

Do a web search for "Exception handling .Net"


>If I created an application class and, suppose, I create a method there to handle errors, how can I ensure that all errors encountered in my whole application will be handled by that class?
>
>Thanks again.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform