Throw() public static method

Reports an error to the user, and provides the option to report if the crash is critical enough
public static Throw ( String message, Exception inner, bool canReport = true ) : void
message String Message to show to the user
inner System.Exception The exception that was thrown/raised
canReport bool If the crash should be allowed to be reported to Bugsense
return void
コード例 #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);
     }
 }
コード例 #2
0
        /// <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);
            }
        }