CustomErrors statusCode 500

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default CustomErrors statusCode 500

    I have a customerrors section in web.config something like the following:

    <customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
    <error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
    <error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
    </customErrors>

    This works fine, but every exception in the app that isn't a 404 error gets
    redirected to the statusCode 500 page which represents an Internal Server
    Error. Is this standard?

    Why doesn't the defaultRedirect page ever get redirected to?

    I have a test page that throws an argumentException and I get redirected to
    errorPage500.aspx. I want this type of exception to go to errorPage.aspx
    which is the default.

    Any help would be appreciated.

    Thanks,
    Jesse


    Jesse Napier Guest

  2. Similar Questions and Discussions

    1. customErrors Not Working
      Hello - I am having difficulties using the customErrors tag in my web.config of a web service I am creating. I am creating two proxies (stub...
    2. Windows authentication Redirect /CustomErrors Issue
      I am using asp.net (1.1) and am setting application security in web.config using: <customErrors mode="On" defaultRedirect="Denied.htm"><error...
    3. customErrors 404
      Hello, Yes you can. What you have to do is to associate these files extensions to the aspnet_isapi.dll in IIS. To accomplish this follow these...
  3. #2

    Default Re: CustomErrors statusCode 500

    That's because an uncaught exception results in 500 error. The default error
    page will be used for errors that do not have a page associated with them,
    in your case everything else than 404 and 500.

    Jerry

    "Jesse Napier" <jnapier@giantsoftware.com> wrote in message
    news:eyCXRpQXDHA.2328@TK2MSFTNGP12.phx.gbl...
    > I have a customerrors section in web.config something like the following:
    >
    > <customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
    > <error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
    > <error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
    > </customErrors>
    >
    > This works fine, but every exception in the app that isn't a 404 error
    gets
    > redirected to the statusCode 500 page which represents an Internal Server
    > Error. Is this standard?
    >
    > Why doesn't the defaultRedirect page ever get redirected to?
    >
    > I have a test page that throws an argumentException and I get redirected
    to
    > errorPage500.aspx. I want this type of exception to go to errorPage.aspx
    > which is the default.
    >
    > Any help would be appreciated.
    >
    > Thanks,
    > Jesse
    >
    >

    Jerry III Guest

  4. #3

    Default Re: CustomErrors statusCode 500

    Thats what I thought. But can other exceptions result in a 500 error or can
    I be confident that any 500 error was an uncaught exception.

    I am handling uncaught exceptions in the appliacation_error event and I just
    want to make sure that the user gets redirected to a friendly page so I let
    the redirection be handled by the custom errors redirection in web.config.

    Does that make sense?


    "Jerry III" <jerryiii@hotmail.com> wrote in message
    news:#$EGEbRXDHA.608@TK2MSFTNGP12.phx.gbl...
    > That's because an uncaught exception results in 500 error. The default
    error
    > page will be used for errors that do not have a page associated with them,
    > in your case everything else than 404 and 500.
    >
    > Jerry
    >
    > "Jesse Napier" <jnapier@giantsoftware.com> wrote in message
    > news:eyCXRpQXDHA.2328@TK2MSFTNGP12.phx.gbl...
    > > I have a customerrors section in web.config something like the
    following:
    > >
    > > <customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
    > > <error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
    > > <error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
    > > </customErrors>
    > >
    > > This works fine, but every exception in the app that isn't a 404 error
    > gets
    > > redirected to the statusCode 500 page which represents an Internal
    Server
    > > Error. Is this standard?
    > >
    > > Why doesn't the defaultRedirect page ever get redirected to?
    > >
    > > I have a test page that throws an argumentException and I get redirected
    > to
    > > errorPage500.aspx. I want this type of exception to go to errorPage.aspx
    > > which is the default.
    > >
    > > Any help would be appreciated.
    > >
    > > Thanks,
    > > Jesse
    > >
    > >
    >
    >

    Jesse Napier Guest

  5. #4

    Default Re: CustomErrors statusCode 500

    | Thats what I thought. But can other exceptions result in a 500 error or
    can
    | I be confident that any 500 error was an uncaught exception.

    Generally yes. Under normal circumstances, 500 is thrown via exception. The
    second way how you can get 500 is when IIS or ISAPI application fails. But
    such situation is not standrd and in such case you cannot catch this
    situation, because it's not running.

    --
    Michal A. Valasek, Altair Communications, [url]http://www.altaircom.net[/url]
    Please do not reply to this e-mail, for contact see [url]http://www.rider.cz[/url]


    Michal A. Valasek Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139