Page 1 of 1

StatusCode.IsGood() during network outage

Posted: 06 Sep 2021, 15:04
by siyadahmed
Hello,
A portion of code is dependent on the following logic in ConnectionStatusUpdate event handler. I am making use of
e.Error.IsGood() to check the status code. But strangely in the event of network disconnection, .IsGood() on the Error object which is an instance of StatusCode class return true, though expected is a false. Below is the portion of event handler logic.

Code: Select all

internal void OnConnectionStatusUpdate(Session sender, ServerConnectionStatusUpdateEventArgs e)
    {          

     
      if(e.Error.IsGood())
      {
        //Assumes connection is good.
      }
      else
      {
        //Assumes connection is not right. Updates connection status.
       }
   }
Is this a known issue or I shouldn't make use of IsGood() in this scenario?