Home All Groups Group Topic Archive Search About

Error handling with web.config

Author
7 Sep 2006 3:28 PM
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.

Author
7 Sep 2006 3:41 PM
JJA
Yes. I just implemented this to my site and it is pretty neat. See:

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_frm/thread/216b8c51bc368ad6/?hl=en&

also:

http://www.codeproject.com/aspnet/ASPNETExceptionHandling.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:
Show quote
> 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.
Author
7 Sep 2006 3:44 PM
Juan T. Llibre
You can't do it just with web.config, but you can do it.

See the sample code at :
http://www.codeproject.com/aspnet/ASPNETExceptionHandling.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/
===================================
Show quote
"VMI" <mye***@excite.com> wrote in message
news:1157642916.719267.235040@d34g2000cwd.googlegroups.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.
>
Author
7 Sep 2006 3:58 PM
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:

Show quote
> 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.

AddThis Social Bookmark Button