473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Getting more detailed errors

I have a question below about an error I am getting:

Exception has been thrown by the target of an invocation.

Is there anyway to get asp.net to give me more details than the above? My
catch statement is as such:

Catch exc As system.Exception
div_updateLog.Visible = true
lbl_updateLog.text = exc.Message
End Try

-Darrel
Nov 19 '05 #1
2 1106
In the applications I develop I catch any exception in the Global_Error event handler in the Global.asax file. Basically I use

Request.FilePath to get the name of the file where the error was thrown
Server.GetLastError.InnerException this is actually the detailed exception you might be looking for .. i find this property extremely useful
Server.GetLastError.StackTrace you get the sequence of procedures executed that lead to the exception
Server.MachineName the server name where the exception ocurred, you can skip this but in my case i have both a development and production server and this property allows me to tell if I caused the exception when developing or the exception was thrown by a user
Request.ServerVariables("HTTP_USER_AGENT") the client browser information ... very useful if you want to create statistics about who mess with your app
Request.ServerVariables("REMOTE_ADDR") the client IP adress where the error ocurred... if you are in an intranet it is useful but if you app is public then you probably are behind a firewall and you will get the firewall IP adress.

I create a report email for every exception. Play around with them and try several ways to catch and handle exceptions

Hope this helps
Alan Ferrandiz Langley
geekswithblogs.com/aferrandiz


"darrel" <no*****@hotmail.com> escribió en el mensaje news:uO*************@TK2MSFTNGP09.phx.gbl...
I have a question below about an error I am getting:

Exception has been thrown by the target of an invocation.

Is there anyway to get asp.net to give me more details than the above? My
catch statement is as such:

Catch exc As system.Exception
div_updateLog.Visible = true
lbl_updateLog.text = exc.Message
End Try

-Darrel

Nov 19 '05 #2
> In the applications I develop I catch any exception in the Global_Error
event handler in the Global.asax file. Basically I use


Alan:

That's a very thorough list. Thank you!

-Darrel
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Terence | last post by:
The XML (expat) extension to PHP contains specific functions for accessing detailed error information when an error occurs parsing an XML packet. All be it convoluted, even the XSLT (Sablotron)...
2
by: Lance Wynn | last post by:
Hello All, In case the subject wasn't completely clear, I just upgraded to Windows XP Pro from Windows 2000 Pro. All my ASP stuff seems to work, except that when an ASP page generates an error,...
8
by: Steve | last post by:
Hi; I'm making an HTML screen that I would like to print on a single page: http://www.geocities.com/beforewisdom/Tech/Archive/ebnfNotation.html Doing a print preview with Mozilla 1.6 on...
8
by: Simon Willison | last post by:
Hi all, I have an API design question. I'm writing a function that can either succeed or fail. Most of the time the code calling the function won't care about the reason for the failure, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.