Example #1
0
 public void CacheError(BugSenseExceptionRequest req, bool isFatal)
 {
     Task t = new Task(async () =>
         {
             LogError err = new LogError(req, isFatal);
             Helpers.Log("begin(CacheError)");
             string res = await err.Execute();
             Helpers.Log("end(CacheError): " + res);
         });
     t.Start();
 }
Example #2
0
		private string CacheTestHandledException (string uuid)
		{
			string res = "";
			
			Exception exc1 = new Exception ("Test exception");
			var request = new BugSenseExceptionRequest (exc1.ToBugSenseEx (null, true, "", "_ping|ev1|ev2"),
				BugSenseEnvironment.GetEnvironment ("test", "0.0.0.0", uuid, true),
				new Dictionary<string, string> () {
					{ "k1", "val1"},
					{ "k2", "val2"},
					{ "k3", "val3"}
			});
			
			LogError err = new LogError (request, false);
			Task.Run (async () => {
				res = await err.Execute ();
			}).Wait ();
			
			return res;
		}
Example #3
0
        public void SendErrorNow(BugSenseExceptionRequest req, bool isFatal,
			bool debugFixResponse = false)
        {
            Task t = new Task(async () =>
                {
                    try
                    {
                        Helpers.Log("begin(SendErrorNow-1)");
                        LogError err = new LogError(req, isFatal);
                        string str = await err.Execute();
                        if (!string.IsNullOrEmpty(str))
                        {
                            try
                            {
                                SendRequest msg = null;
                                if (isFatal)
                                    msg = new SendRequest(str, FixNotificationAndDieAction);
                                else
                                    msg = new SendRequest(str, FixNotificationAction);
                                if (debugFixResponse)
                                    msg.setDebugFixedResponse(true);
                                _lockToSend.WaitOne();
                                Helpers.Log("begin(SendErrorNow-2)");
                                bool res = await msg.Execute();
                                Helpers.Log("end(SendErrorNow-2): " + res);
                                _lockToSend.Release();
                            }
                            catch (Exception)
                            {
                                Helpers.Log("fail(SendErrorNow)");
                            }
                        }
                        Helpers.Log("end(SendErrorNow-1)");
                    }
                    catch (Exception)
                    {
                        Helpers.Log("fail(SendErrorNow)");
                    }
                });
            t.Start();
        }