>>>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.
Exception properties are read only so the best you can do is something like:
throw new Exception(ex.Message + ex.InnerException.Message, ex);