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

Error handling with web.config

VMI
I was told that you can add something to web.config so that I can see
any exception that pops out in my web application. In my case, the web
app captures almost every exception but displays a useless, generic
error for all of them. I don't want to modify any of that code, so I
want to add something that wil let me see all the errors (either on
screen or an ascii file) without having to modify any exception
handling code. I need this because the application generates an error
when I use it in the production environment.
Is this possible through web.config? If not, is there another way?

Thanks.

Sep 7 '06 #1
3 1667
JJA
Yes. I just implemented this to my site and it is pretty neat. See:

http://groups.google.com/group/micro...368ad6/?hl=en&

also:

http://www.codeproject.com/aspnet/AS...onHandling.asp

Now I am chasing an error in a COM object that is NOT being trapped by
this technique but this should help you I think.

VMI wrote:
I was told that you can add something to web.config so that I can see
any exception that pops out in my web application. In my case, the web
app captures almost every exception but displays a useless, generic
error for all of them. I don't want to modify any of that code, so I
want to add something that wil let me see all the errors (either on
screen or an ascii file) without having to modify any exception
handling code. I need this because the application generates an error
when I use it in the production environment.
Is this possible through web.config? If not, is there another way?

Thanks.
Sep 7 '06 #2
You can't do it just with web.config, but you can do it.

See the sample code at :
http://www.codeproject.com/aspnet/AS...onHandling.asp


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"VMI" <my****@excite.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
>I was told that you can add something to web.config so that I can see
any exception that pops out in my web application. In my case, the web
app captures almost every exception but displays a useless, generic
error for all of them. I don't want to modify any of that code, so I
want to add something that wil let me see all the errors (either on
screen or an ascii file) without having to modify any exception
handling code. I need this because the application generates an error
when I use it in the production environment.
Is this possible through web.config? If not, is there another way?

Thanks.

Sep 7 '06 #3
VMI
Thanks for the posts.
I haven't tested it yet because I wanted to make sure that these
examples will display any error messages that are already being
captured by a try...catch. I can't modify any of the
exception-handling code.
For example, if I change something in the connectionStirng (i.e. the
server name) and the user can't connect to it since it doesn't exist,
the application will display the message "Wrong user/password
combination". I cannot change that try...catch code so I need
something that will display the real message without having to modify
anything.

THanks.

VMI ha escrito:
I was told that you can add something to web.config so that I can see
any exception that pops out in my web application. In my case, the web
app captures almost every exception but displays a useless, generic
error for all of them. I don't want to modify any of that code, so I
want to add something that wil let me see all the errors (either on
screen or an ascii file) without having to modify any exception
handling code. I need this because the application generates an error
when I use it in the production environment.
Is this possible through web.config? If not, is there another way?

Thanks.
Sep 7 '06 #4

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

Similar topics

0
by: Kamal Dhingra | last post by:
Hi Guys, I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
2
by: Wayne | last post by:
I have an application where I added a comment as the first line of my Config file, as I found out I can't do this. However, an entry was made in the event log about the error (Source = .net...
3
by: Fred Nelson | last post by:
I'm devloping a Web Application in VB.NET. In my web.config file I have specified that untrapped errors are to be sent to the page "errorpage.aspx". This is working fine - if an untrapped error...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
3
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom...
2
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access...
0
by: David Lozzi | last post by:
Howdy, I'm working on some error handling for my application. Currently on WinXP Pro SP2. Basically this is what I'm doing: Try...Catch at the method level, Catch sends email with error ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.