One strategy to deal with error reporting in the
situation you mentioned:
1) Throw an exception in your base objects(worker
objects, business objects, or whatever you name
it)when error occurs, also report to the database the
error message and the class and method where exception
occurs
2) The web presentation layer(ie, .aspx.vb or .aspx.cs
files) catch the exception
3) Have a web page dedicated to custom error
reporting, for example: customError.aspx, and in
web.config file, add following section under
<System.Web>, something like this:
<System.Web>
    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly"
to enable custom error messages, "Off" to disable. 
          Add <error> tags for each of the errors you
want to handle.
    -->
    <customErrors mode="On"
defaultRedirect="customError.aspx">
                <error statusCode="404" redirect="error404.html"/>
                <error statusCode="500" redirect="error500.html"/>
    </customErrors>
</System.Web>
4)You can also report to database the error messages
in customError.aspx.cs(or customError.aspx.vb).

Ying Jin
--- biirir <[EMAIL PROTECTED]> wrote:

> I'm having a problem with this and hopefully someone
> can help.
> 
> I have subroutines within subroutines and if an
> error occurred in a 
> subroutine I want the asp.net page to show a english
> friendly message 
> of what the error was and I want the save to the
> database in which 
> subroutine the error occurred.
> 
> How can I acheive this. 
> 
> If anyone knows of good error reporting strategies
> please let me know.
> 
> Thank you
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to