Up to now when ever, whenever I wanted to Show the Exceptionshow an exception thrown from my code I used:
try { ///// Code that may throws several typesthrow ofdifferent Exceptionsexceptions } catch (Exception ex) { MessageBox.Show(ex.ToString()); } I used the above code mainly for debugging reasons, in order to see the exact type of exception and the according reason the exception was thrown.
In a project I am creating now, I use several try-catchtry-catch clauses and I would like to display a pop up Messagepopup message in case of an Exception thatexception, to make it would be "Usermore "user friendly".
By "User"user friendly", I mean a Messagemessage that would hide phrases like: "Null Reference Exception" Null Reference Exception or "Argument Out of Range Exception"Argument Out Of Range Exception that are currently displayed with the above code. However
However I want, still the messagewant to sosee relevant info with the type of Exceptionexception that created the message.
Is there a way to format the displayed output of thrown exceptions according to previous needs?