locked
Handling "No Responce" Error RRS feed

  • Question

  • User749817581 posted

    There is a heavy traffic on our servers from 11:00AM to 2:00PM

    Is there any way to show any appropriate error message when there is no response from the web server to the client ?

    Your prompt reply would be highly appreciated.

    Thanks in advance.

    Monday, September 8, 2014 1:56 AM

Answers

  • User-417640953 posted

    There is a heavy traffic on our servers from 11:00AM to 2:00PM

    Is there any way to show any appropriate error message when there is no response from the web server to the client ?

    Hi Afshin_Zavar,

    Thank you post the issue to our forum.

    Based on what you said, I see the response will be timeout when server heavy traffic. For this issue I think you can catch those

    exceptions in the  global.asax Application_Error method like below:

     void Application_Error(object sender, EventArgs e)
            {
                // Code that runs when an unhandled error occurs
    
                Exception ex = Server.GetLastError();
                
                if ( ex is TimeoutException) 
                { 
                   //redirect to friendly page
                    Response.Redirect("CustomError1.aspx");
                     
                }
                if (ex is SqlException)
                {
                    //redirect to friendly page
                    Response.Redirect("CustomError2.aspx");
    
                }
                //..........
    
            }

    Then you can redirect friendly page to client during heavy traffic time. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 9, 2014 10:23 PM

All replies

  • User1633621018 posted

    Hi Afshin,

    I would suggest when you make request to the web server for data just show some message or show a data loader to the user. After a certain time span if you don't get the response from the server prompt your user to either continue and wait for the response or kill the process. Ajax would come handy in this process.  You cannot do much if your server is not responding.

    Regards

    Pawan

    Monday, September 8, 2014 3:05 AM
  • User749817581 posted

    It's annoying because stored procedures return invalid values due to server response and I can't do much.

    Tuesday, September 9, 2014 12:42 AM
  • User4068423 posted

    You can set the timeout value in web.config file and also if you use asynchronous model basically it will not halt application execution and after set defined timeout value just display the descriptive message to the user.

    Tuesday, September 9, 2014 5:11 PM
  • User-417640953 posted

    There is a heavy traffic on our servers from 11:00AM to 2:00PM

    Is there any way to show any appropriate error message when there is no response from the web server to the client ?

    Hi Afshin_Zavar,

    Thank you post the issue to our forum.

    Based on what you said, I see the response will be timeout when server heavy traffic. For this issue I think you can catch those

    exceptions in the  global.asax Application_Error method like below:

     void Application_Error(object sender, EventArgs e)
            {
                // Code that runs when an unhandled error occurs
    
                Exception ex = Server.GetLastError();
                
                if ( ex is TimeoutException) 
                { 
                   //redirect to friendly page
                    Response.Redirect("CustomError1.aspx");
                     
                }
                if (ex is SqlException)
                {
                    //redirect to friendly page
                    Response.Redirect("CustomError2.aspx");
    
                }
                //..........
    
            }

    Then you can redirect friendly page to client during heavy traffic time. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 9, 2014 10:23 PM