473,408 Members | 1,623 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,408 software developers and data experts.

Error Handler

I have set up an error handler in the Global.asax, but it doesn't give me
the information I can get from the Normal Windows Error page.

This is really preventing me from being able to fix errors quickly as it
only tells me I got an error, but normally not much on what the error was.

If I have no Handler, I get the following:

************************************************** ****************
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30205: End of statement expected.

Source Error:

Line 43: if not IsPostBack then
Line 44: Page.RegisterHiddenField("__EVENTTARGET", "Button2")
Line 45: Dim currentWindowsUser As New IIdentity =
WindowsIdentity.GetCurrent(); <--- the error in red
Line 46: trace.warn("currentWindowsUser.Name = " +
currentWindowsUser.Name);
Line 47: trace.warn("currentWindowsUser.AuthenticationType = " &
currentWindowsUser.AuthenticationType);

Source File: C:\Inetpub\wwwroot\staffingworkshop\tomtest.aspx Line: 45
************************************************** ***************

In my Global.asax I have
************************************************** *********************
Sub Application_Error(Sender As Object, E as EventArgs)
Dim exception As Exception = Server.GetLastError()
Dim ErrorString as String

While Not exception Is Nothing
ErrorString &= "Source: " & exception.Source & vbCrLf & _
"Message: " & exception.Message & vbCrLf & _
"Stack Trace: " & vbCrLf & exception.StackTrace & vbCrLf &
vbCrLf
exception = exception.InnerException
End While

Dim MyMessage as New MailMessage
MyMessage.To = "xx@solutions.com;yy@yahoo.com"
MyMessage.From = "xx@solutions.com"
MyMessage.Subject = "Unhandled ASP.Net Error"
MyMessage.Body = vbCrLf & vbCrLf & "An Error was Generated on " & now &
vbCrLf & vbCrLf & _
"To see a list of Errors:
HTTP:\\www.staffingworkshop.com\administration\sho wExceptions.aspx" & vbCrLf
& vbCrLf & _
"Page: " & HTTPContext.Current.Request.Url.ToString() & vbCrLf &
vbCrLf & ErrorString

SmtpMail.SmtpServer = Application("MailServer")
SmtpMail.Send(MyMessage)

Context.ClearError()
response.Redirect("/PageError.aspx")
End Sub
************************************************** *********************

What I get in my Email is:

************************************************** ************************
An Error was Generated on 4/24/2006 5:52:48 PM

To see a list of Errors: HTTP:\\www.xx.com\ad\showExceptions.aspx

Page: http://www.xx.com/test.aspx

Source: System.Web
Message: External component has thrown an exception.
Stack Trace:
at System.Web.UI.TemplateParser.GetParserCacheItemInt ernal(Boolean
fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWit hNewConfigPath()
at System.Web.UI.TemplateParser.GetParserCacheItem()
at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)
at
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)

Source: System.Web
Message: External component has thrown an exception.
Stack Trace:
at
System.Web.Compilation.BaseCompiler.ThrowIfCompile rErrors(CompilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
sourceFile, String sourceString)
at System.Web.Compilation.BaseCompiler.GetCompiledTyp e()
at System.Web.UI.PageParser.CompileIntoType()
at System.Web.UI.TemplateParser.GetParserCacheItemThr oughCompilation()
************************************************** ************************

As you can see, it tells me nothing????

Sometimes I will get decent errors, but more often than not I get something
like this.

This is really preventing me from being able to proactively fix errors on my
site as it only tells me I got an error, but not much on what the error was.

I have been trying to figure this out for months. There must be a better
way.

Thanks,

Tom
Apr 25 '06 #1
0 1230

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

Similar topics

13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
2
by: Randy Harris | last post by:
I thought that I had a grasp of how VBA error handling functioned, but have just become painfully aware that I don't. I thought that the "On Error GoTo 0" in the second sub below would turn off...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
16
by: Steve Jorgensen | last post by:
I'm trying to figure out if there is a way to generate standard error handlers that "know" if the calling code has an error handler in effect (On Error Goto <label> or On Error Resume Next) before...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
2
by: robert d via AccessMonster.com | last post by:
I have a module with an error handler section. At the top of the module is the following statement: On Error GoTo Err_Ctrl In the error handler is a conditional If statement based on an error...
10
by: robert d via AccessMonster.com | last post by:
I have a global error handler that up until today has been working flawlessly. Let me first provide the relevant code **************************************************************** On Error...
2
by: Jukka Aho | last post by:
When converting Unicode strings to legacy character encodings, it is possible to register a custom error handler that will catch and process all code points that do not have a direct equivalent in...
4
by: jdokos | last post by:
Hello All, I have a procedure that is getting -443 after upgrading to V9.5 FP1. The procedure was written to output only the SQLCODE. Here is the output that is returned: Value of output...
9
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.