Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception handling
Message
 
 
À
26/05/2017 03:14:28
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01651425
Message ID:
01651528
Vues:
36
>>Hi Viv,
>>
>>My message perhaps was not very clear. I am asking about the line throw ex - is it possible to enhance this line to include inner exception directly?
>
>As above ex DOES include the inner exception (if there is one). If you want to discard the top level exception and simply pass the inner exception then use:
throw ex.InnerException
>
>
>>
>>That error is later shown on the screen and it says exactly 'error such and such see inner exceptions for details'. This message is not very helpful to the user. I can try to see where in the interface code we're showing that exception and may be add some code there but I've been wondering if it somehow possible when I throw exception enhance its message to include the text of the inner exception directly into the message.


No, I want to pass the original exception but the message should include both original exception + Inner exception if it exists in one message. Not the current standard text saying that you have to look at the inner exception.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform