473,804 Members | 3,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.RegisterHi ddenField("__EV ENTTARGET", "Button2")
Line 45: Dim currentWindowsU ser As New IIdentity =
WindowsIdentity .GetCurrent(); <--- the error in red
Line 46: trace.warn("cur rentWindowsUser .Name = " +
currentWindowsU ser.Name);
Line 47: trace.warn("cur rentWindowsUser .Authentication Type = " &
currentWindowsU ser.Authenticat ionType);

Source File: C:\Inetpub\wwwr oot\staffingwor kshop\tomtest.a spx Line: 45
*************** *************** *************** *************** *****

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

While Not exception Is Nothing
ErrorString &= "Source: " & exception.Sourc e & vbCrLf & _
"Message: " & exception.Messa ge & vbCrLf & _
"Stack Trace: " & vbCrLf & exception.Stack Trace & vbCrLf &
vbCrLf
exception = exception.Inner Exception
End While

Dim MyMessage as New MailMessage
MyMessage.To = "xx@solutions.c om;yy@yahoo.com "
MyMessage.From = "xx@solutions.c om"
MyMessage.Subje ct = "Unhandled ASP.Net Error"
MyMessage.Body = vbCrLf & vbCrLf & "An Error was Generated on " & now &
vbCrLf & vbCrLf & _
"To see a list of Errors:
HTTP:\\www.staf fingworkshop.co m\administratio n\showException s.aspx" & vbCrLf
& vbCrLf & _
"Page: " & HTTPContext.Cur rent.Request.Ur l.ToString() & vbCrLf &
vbCrLf & ErrorString

SmtpMail.SmtpSe rver = Application("Ma ilServer")
SmtpMail.Send(M yMessage)

Context.ClearEr ror()
response.Redire ct("/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.T emplateParser.G etParserCacheIt emInternal(Bool ean
fCreateIfNotFou nd)
at System.Web.UI.T emplateParser.G etParserCacheIt emWithNewConfig Path()
at System.Web.UI.T emplateParser.G etParserCacheIt em()
at
System.Web.UI.T emplateControlP arser.CompileAn dGetParserCache Item(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.T emplateControlP arser.GetCompil edInstance(Stri ng
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.P ageParser.GetCo mpiledPageInsta nceInternal(Str ing
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.P ageHandlerFacto ry.GetHandler(H ttpContext context,
String requestType, String url, String path)
at System.Web.Http Application.Map HttpHandler(Htt pContext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)
at
System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously)

Source: System.Web
Message: External component has thrown an exception.
Stack Trace:
at
System.Web.Comp ilation.BaseCom piler.ThrowIfCo mpilerErrors(Co mpilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
sourceFile, String sourceString)
at System.Web.Comp ilation.BaseCom piler.GetCompil edType()
at System.Web.UI.P ageParser.Compi leIntoType()
at System.Web.UI.T emplateParser.G etParserCacheIt emThroughCompil ation()
*************** *************** *************** *************** **************

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 1248

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

Similar topics

13
6621
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
2912
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 error handling for that procedure. I single stepped the program, it gets an error on the last line (the Name Workdir... line), the next command to execute is Resume SkipReport. I know why the error occurs, but I don't understand how it resumes...
6
4765
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 appreciated. Thanks in advance
16
2655
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 deciding how to respond. Does anyone know if this is possible.
13
4491
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 runs into problems on the system where it will actually be used, and since I used so little error-trapping it dies very ungracefully. I will of course try to fix whatever is causing the error and add error-trapping to the functions where the...
2
1832
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 number. If the user selects a certain response, the code exits the error handler and goes back up to a line of code in the module to continue processing. This works as expected.
10
3769
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 GoTo Err_Ctrl 'This code is generating the error If Nz(Me.SubformCont.Form!txtUsage,"") = "' Then Msg "There's a problem"
2
2486
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 the target encoding (as described in PEP 293). The thing to note here is that the error handler itself is required to return the substitutions as Unicode strings - not as the target encoding bytestrings. Some lower-level gadgetry will silently...
4
7747
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 parameters -------------------------- Parameter Name : V_OUTPUT Parameter Value : ERR:-443
9
2274
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 error_handler function just like the error_reporting ini setting controls which errors are shown. Without this mask set the error_handler will be called for every error regardless to the setting of the error_reporting setting.
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.