Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dealing with inner exceptions
Message
From
22/04/2013 10:44:35
 
 
To
22/04/2013 10:13:39
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01571592
Message ID:
01571596
Views:
37
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform