Handles error reporting
Example #1
0
 /// <summary>
 /// Sends a string to the remote websocket client
 /// passing in default values for the second and third param
 /// </summary>
 /// <param name="info">The information to send</param>
 private void WSReport(String info)
 {
     try
     {
         Context.Send(info);
     }
     catch (Exception e)
     {
         CrashHandler.Throw("There was an issue communicating with the UI!", e);
     }
 }
        /// <summary>
        /// Report a string to the remote proxy
        /// </summary>
        /// <param name="info">The information to send</param>
        /// <param name="close">Whether to close the connection afterwards or not</param>
        public virtual void Report(String info, bool close = false)
        {
            if (Remote == null || !_canSend)
            {
                return;
            }

            try
            {
                Remote(info);
                if (close)
                {
                    Close();
                }
            }
            catch (Exception e)
            {
                _canSend = false;
                CrashHandler.Throw(e.Message, e);
            }
        }