shieldguy
asked on
How to read only the error line number from exception
In asp.net i am trying to read only error message after i caught exception,
how can I do it
I would realy appreciate any examples
Thanks
how can I do it
I would realy appreciate any examples
Thanks
Try
.....
.....
.....
Catch ex As Exception
'ADDING THE MORE MEANINGFUL INFORMATION TO EXCEPTION
'BUT ONLY ADD NEW EXCEPTION THEIR IS NOT ALREADY ANY DETAIL ADDED BEFORE
If ex.Data("Class") Is Nothing Then
ex.Data.Clear()
ex.Data("Class") = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString()
ex.Data("Function") = System.Reflection.MethodBase.GetCurrentMethod().Name
End If
'THROWING THE EXCEPTION AGAIN SO IT WILL BE CATCH AT THE HIGHER LEVEL
Throw ex
End Try
ASKER
no just a error line no?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ex.Message ?