>I am adding support to get the inner exceptions, when we have such a situation.
>
>So, in regular cases, the code goes in here:
>
>
> ' If we had an error
> If Not oServer.GetLastError() Is Nothing Then
> loError = oServer.GetLastError().GetBaseException()
> lcError = Trim(loError.Message) + "1"
> lcStackTrace = loError.StackTrace
>
> ' If we have an exception
> If Not loError.InnerException Is Nothing Then
> lcError = lcError + "2"
> 'lcError = lcError + oApp.GetInnerException(loError.InnerException)
> End If
>
> End If
>
>
>From my application, I have forced an error like this:
>
>
> Try
> loRow = loData.oRows(0)
> Catch ex As Exception
> Throw New Exception("Ok, here is the exception", ex.InnerException)
> End Try
>
>
>So, the first one is an "Object reference not found".
>The second one is "Ok, here is the exception".
>
>But, in my error handling, I still only get the last exception, identified here by "Ok, here is the exception1". I would have expected to get that line followed by "2" as this is what I put temporary in my code to look up the chain of exception.
>
>Anyone would know why it does not recognize that there is another level higher in the chain?
Shouldn't it be :
Throw New Exception("Ok, here is the exception", ex)