+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Displaying custom error page when database is down

Displaying custom error page when database is down

6 posts, 0 answered
  1. Rajesh
    Rajesh avatar
    6 posts
    Registered:
    12 Nov 2010
    17 Feb 2011
    Link to this post
    I am creating a CustomErrorPage.html that would be called when there is a problem connecting to the database. CustomErrorPage.html is simple html page with no database connection.

    I am raising an HTTPException with custom status code(999) and have  added following entry in CustomErrors  section of in web.config
      <error redirect="~/CustomErrorPage.html" statusCode="999"/>

    The code works fine and it redirects to CustomErrorPage.html but while trying to load this page it still tries to connect to database. It appears that its trying to load the page through Sitefinity framework.

    Is there any way to exclude rendering of certain pages through Sitefinity and load them directly?

    Thanks
    Rajesh
  2. Rajesh
    Rajesh avatar
    6 posts
    Registered:
    12 Nov 2010
    24 Feb 2011
    Link to this post
    Any suggesstions or information for  the above query?

    Thanks
    Rajesh
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    25 Feb 2011
    Link to this post
    Hi Rajesh,

    Unfortunately if the database is down the website with throw errors. You can try to make some redirect directly from Application_Error of the global.asax.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
  4. Rajesh
    Rajesh avatar
    6 posts
    Registered:
    12 Nov 2010
    27 Feb 2011
    Link to this post
    On error, It is not going into Application_Error of global.asax.  Any ideas, why? I am using sitefinity v3.7

    Thanks
    Rajesh
  5. Rajesh
    Rajesh avatar
    6 posts
    Registered:
    12 Nov 2010
    01 Mar 2011
    Link to this post
    It does not go into Application_Error when it can not connect to SQL database. Just throws a raw error to user.
    Can you suggest any workaround that would allow to show a custom error page when db is down?

    Thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    02 Mar 2011
    Link to this post
    Hello Rajesh,

    If the database server is down there should be an error thrown inside Application_Error. If you use web application, please make sure your have rebuild the website.

    Greetings,
    Ivan Dimitrov
    the Telerik team
Register for webinar
6 posts, 0 answered