Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception handling
Message
De
25/05/2017 12:12:22
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01651425
Message ID:
01651487
Vues:
60
This message has been marked as a message which has helped to the initial question of the thread.
>>Why not just test for the presence of the innerexception != null and if it isn't set the errormessage to that text.
>>
>>
>>   var msg = "";
>>   if(string.IsNotNull(ex.InnerException))
>>   {
>>        msg = ex.InnerException;
>>        throw new DuplicatePropertyException(msg);
>>   }
>>
>>
>
>This is not what I am asking. I am asking specifically about
>
>throw ex
>
>part.
>
>In the throw ex is there a way to append that inner exception? E.g. what should I throw?

You care a new message like I showed you and throw a new exception with that message. You can't append to ex.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform