Display\Capture InnerException Message

Posted by madlan on Stack Overflow See other posts from Stack Overflow or by madlan
Published on 2010-06-12T23:16:28Z Indexed on 2010/06/12 23:22 UTC
Read the original article Hit count: 334

Filed under:

I was using the following to provide more information on a common exception that can occour in a piece of my code, the only problem is this errors if an exception is generated that has no InnerException message.

Catch ex As Exception
     'MessageBox.Show(ex.Message) 'If there is no InnerException.
     MessageBox.Show(ex.InnerException.InnerException.Message)
End Try

Is there a better method of doing this?

© Stack Overflow or respective owner

Related posts about vb.net