Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Base Exception

Status
Not open for further replies.

manishjoisar

Programmer
Apr 29, 2002
52
IN
I have created One DLL
Public Class MyClass
Public Function MyFunction
Try
...
...
Catch Ex As Exception
Throw Ex
End Try
End Function
End Class

Aspx file
Try
Call MyClass.MyFunction
Catch Ex As Exception
TextBox1.Ex.ToString()
End Try

In this case if am getting Line no. Of Throw Ex I want the Exact Line No. With Whole Trace From Start To End
How To Get This

Thanks
 
>>In this case if am getting Line no. Of Throw Ex I want the Exact Line No. With Whole Trace From Start To End
How To Get This

ie u want the error that has occured in the DLL code???

Known is handfull, Unknown is worldfull
 
oops, my mistake, didnt read the question correctly.

i dont thin that is possible, the exception thrown will always be in context with the page that throws it (in this case the ASPX file).

Known is handfull, Unknown is worldfull
 
an alternative would be to build ur own exception class:
Public Class MyException
Inherits Exception
Public Sub New(TheMessage As String)
MyBase.New(TheMessage)
End Sub
end class


in ur Try code:
Public Class MyClass
Public Function MyFunction
Try
...
...
Catch Ex As Exception
Throw new MyException("ERROR!!!!")
End Try
End Function
End Class



Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top