public int SystemError(uint Error, uint Level)
 {
     ExceptionHit?.Invoke(this, new EXCEPTION_RECORD64 {
         ExceptionCode = Error
     });
     return(HResult.Ok);
 }
Exemple #2
0
        public static async Task <bool> SendAsync(ITracker tracker, string exceptionDescription, bool fatal)
        {
            var hit = new ExceptionHit(exceptionDescription, fatal)
            {
                DataSource = "app"
            };

            // create the hit request.
            var request = (HitRequestBase)tracker.CreateHitRequest(hit);

            // Run a debug check to ensure its valid.
            var debugResponse = await request.ExecuteDebugAsync();

            if (!((DebugResult)debugResponse).IsValid())
            {
                return(false);
            }

            // Send hit.
            var collectRequest = await request.ExecuteCollectAsync();

            Console.Write(collectRequest.RawResponse);

            return(true);
        }
Exemple #3
0
        public void Create_Exception_invalid_throwsException()
        {
            var hit = new ExceptionHit(ExecptionDescription, ExecptionIsFatal);

            hit.ExceptionIsFatal = "goboom";

            Assert.Throws <ArgumentOutOfRangeException>(() => hit.Validate());
        }
Exemple #4
0
        public void Create_ExceptionHit_All_Validate_Values()
        {
            var hit = new ExceptionHit(ExecptionDescription, ExecptionIsFatal);

            Assert.Equal(ExecptionDescription, hit.ExceptionDescription);
            Assert.Equal(hit.ExceptionIsFatal, ExceptionIsFatal);
            Assert.Equal(HitType, hit.HitType, true);
        }
Exemple #5
0
        public void Create_ExceptionHit_All_Validate_Success()
        {
            var hit = new ExceptionHit(ExecptionDescription, ExecptionIsFatal);

            Assert.True(hit.Validate());
        }
 private void OnException(object sender, EXCEPTION_RECORD64 e)
 {
     var threadId = GetCurrentThread();
     ExceptionHit?.Invoke((int)e.ExceptionCode, threadId);
 }
 public int Exception(ref EXCEPTION_RECORD64 Exception, uint FirstChance)
 {
     ExceptionHit?.Invoke(this, Exception);
     return((int)DEBUG_STATUS.BREAK);
 }