Question

Quand mon application plante totalement, je wan't pour être en mesure de se connecter pour vérifier que ce qui est arrivé après. Si je veux continuer comme il était uncaught, est-il correct de réémettre en cas de CurrentDomain_UnhandledException? Je ne pas se laisser mon code continuer comme je ne sais pas dans quel état il est.

Alors dois-je faire ceci:

static void CurrentDomain_UnhandledException(
    object sender, 
    UnhandledExceptionEventArgs e)
{
    if (logger.IsFatalEnabled)
        logger.Fatal("A fatal unhandled error occurred.", 
            (Exception)e.ExceptionObject);
    throw (Exception)e.ExceptionObject;
}

ou cela?

static void CurrentDomain_UnhandledException(
    object sender, 
    UnhandledExceptionEventArgs e)
{
    if (logger.IsFatalEnabled)
        logger.Fatal("A fatal unhandled error occurred.", 
            (Exception)e.ExceptionObject);
}

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top