public override void HandleMessage(Session session, Message message)
        {
            if (message.Template.Equals(AlertTemplate))
            {
                var error = (DynError) message.GetInt(2);

                if (error == DynError.Close)
                {
                    session.Close(error);
                }
                else
                {
                    session.ErrorHandler.OnError(null, error, message.GetString(4));
                }
            }
        }
 public void HandleMessage(Session session, Message message)
 {
     var alertCode = (DynError) message.GetInt(2);
     if (alertCode == DynError.Close)
     {
         session.Close(alertCode);
     }
     else
     {
         session.ErrorHandler.OnError(null, alertCode, message.GetString(4));
     }
 }