private void ExceptionListener(object sender, ExceptionEventArgs e)
        {
            Console.WriteLine ("Exception handler called");

            String message = e.Message;
            Console.WriteLine (message);
        }
예제 #2
0
		/// <summary>
		/// Handles the Error event of the surveillanceDossiers control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:Sycorax.AutoUpdate.ExceptionEventArgs"/> instance containing the event data.</param>
		void surveillanceDossiers_Error (object sender, ExceptionEventArgs e) {
			//Log de l'erreur dans l'event viewer
			EventLog.WriteEntry(e.RaisedException.Source, e.RaisedException.Message, EventLogEntryType.Error);
			//Si le mode debug est actif, on affiche également le stacktrace dans une boîte de dialogue
			if (Program.options.DebugMode) {
				MessageBox.Show(e.RaisedException.StackTrace, e.RaisedException.Message, MessageBoxButtons.OK, MessageBoxIcon.Warning);
			}
		}
예제 #3
0
        /// <summary>触发异常</summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnError(Object sender, ExceptionEventArgs e)
        {
            base.OnError(sender, e);

            // 出现重置错误,可能是UDP发送时客户端重置了,标识错误,让所有循环终止
            //if (e.LastOperation == SocketAsyncOperation.ReceiveFrom && e.SocketError == SocketError.ConnectionReset) hasError = true;
            hasError = true;
        }
예제 #4
0
 void Fault(object sender, ExceptionEventArgs e)
 {
     log.LogError("Confuser", "CR003", "Confuser",
         0, 0, 0, 0, string.Format(@"***************
     ERROR IN CONFUSER!!
     Message : {0}
     Stack Trace : {1}
     ***************", e.Exception.Message, e.Exception.StackTrace));
     ReturnValue = false;
 }
예제 #5
0
        void Nameserver_AuthenticationError(object sender, ExceptionEventArgs e)
        {
            System.Media.SoundPlayer sound = new System.Media.SoundPlayer();
            sound.SoundLocation = @"C:\Windows\Media\Windows Error.wav";
            sound.Play();

            MessageBox.Show("Authentication failed, check your emailaddress or password.", e.Exception.InnerException.Message);
            btnLogin.Content = "Login";
            btnLogin.IsEnabled = true;
        }
예제 #6
0
 private static void executor_Error(object sender, ExceptionEventArgs e)
 {
     if (e.Exception != null)
     {
         Console.WriteLine(e.Exception.Message);
         if (!e.ExceptionHandled)
         {
             acDomain.LoggingService.Error(e.Exception);
         }
     }
 }
예제 #7
0
        void IExtensionErrorHandler.HandleError(object sender, Exception exception)
        {
            if (_ignoreAll)
            {
                return;
            }

            if (_errorThrownEvent != null)
            {
                var args = new ExceptionEventArgs(exception);
                _errorThrownEvent(this, args);
            }
        }
			public DebugEventResponse OnException(int threadID, ExceptionRecord record)
			{
				var thread = owner.FindThread(threadID);
				if (thread == null)
				{
					Contract.Assert(false, "Received exception from unknown thread.");
					return DebugEventResponse.ContinueUnhandled;
				}

				if (record.Code == Kernel32.EXCEPTION_BREAKPOINT && owner.TryCompleteBreakTask(thread))
				{
					return DebugEventResponse.Break;
				}
				else
				{
					var eventArgs = new ExceptionEventArgs(thread, record);
					return owner.RaiseEvent(owner.ExceptionRaised, eventArgs);
				}
			}
        public void OnError(ExceptionEventArgs args)
        {
            if (Error != null)
                Error(this, args);

            MessageBox.Show(
                "An error occurred while updating the application:" +
                Environment.NewLine + Environment.NewLine + 
                args.Exception.Message,
                "Error",
                MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }
예제 #10
0
파일: Program.cs 프로젝트: wasabii/UcmaKit
 static void p_UnhandledException(object sender, ExceptionEventArgs e)
 {
     Console.WriteLine(e.Exception);
 }
예제 #11
0
 private static void DefaultUnhandledExceptionHandler(object source, ExceptionEventArgs eventArgs)
 {
     Console.Error.WriteLine(eventArgs.Exception);
 }
예제 #12
0
파일: CacheEntry.cs 프로젝트: rmarinho/AgFx
 void CacheLoader_Failed(object s, ExceptionEventArgs e)
 {
     // if the cache load failed, make sure we're doing a live load.
     // if we aren't, kick one off.
     //
     NextCompletedAction.UnregisterLoader(LoaderType.CacheLoader);
     if (!_liveLoader.IsBusy && !HaveWeEverGottenALiveValue)
     {
         NextCompletedAction.RegisterActiveLoader(LoaderType.LiveLoader);
         _liveLoader.FetchData(true);
     }
 }
예제 #13
0
 private void Nameserver_AuthenticationError(object sender, ExceptionEventArgs e)
 {
 }
예제 #14
0
 private void NameserverProcessor_ConnectingException(object sender, ExceptionEventArgs e)
 {
 }
예제 #15
0
 static void Footloose_ExceptionOccurred(object sender, ExceptionEventArgs e)
 {
     Console.WriteLine("Exception occured: " + e.Exception);
 }
 private void FireException(ExceptionEventArgs e)
 {
     var handler = Exception;
     if (handler != null)
         handler(this, e);
 }
예제 #17
0
		/// <summary>
		/// Raises the Exception event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected internal virtual void OnException(object sender, ExceptionEventArgs e) 
		{
			// save the exception so that we can retrieve it later if we want to
			_lastException = e.Exception;

			try
			{
				Debug.WriteLineIf(_verbose, string.Format("Exception encountered on Tcp connection '{0}' of '{1}'.", _id, e.Exception.ToString()), MY_TRACE_CATEGORY);

				if (this.Exception != null)
					this.Exception(sender, e);
			}
			catch(ThreadAbortException)
			{

			}
			catch(Exception ex) 
			{
				Trace.WriteLine(ex, MY_TRACE_CATEGORY);	
			}
		}
예제 #18
0
 /// <summary>
 /// The internal event handler that handles the <see cref="CommunicationException"/> event.
 /// </summary>
 /// <param name="e">The source of the event.</param>
 protected virtual void OnCommunicationException(ExceptionEventArgs e)
 {
     if (CommunicationException != null)
     {
         CommunicationException(this, e);
     }
 }
예제 #19
0
 private void Nameserver_AuthenticationError(object sender, ExceptionEventArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke(new EventHandler<ExceptionEventArgs>(Nameserver_AuthenticationError), new object[] { sender, e });
     }
     else
     {
         MessageBox.Show("Authentication failed, check your account or password.\r\n Error detail:\r\n " + e.Exception.InnerException.Message + "\r\n"
             + " StackTrace:\r\n " + e.Exception.InnerException.StackTrace
             , "Authentication Error");
         SetStatus("Authentication failed");
     }
 }
예제 #20
0
 private void NameserverProcessor_ConnectingException(object sender, ExceptionEventArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke(new EventHandler<ExceptionEventArgs>(Nameserver_ExceptionOccurred), new object[] { sender, e });
     }
     else
     {
         MessageBox.Show(e.Exception.ToString(), "Connecting exception");
         SetStatus("Connecting failed");
     }
 }
예제 #21
0
 private void Nameserver_ExceptionOccurred(object sender, ExceptionEventArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke(new EventHandler<ExceptionEventArgs>(Nameserver_ExceptionOccurred), new object[] { sender, e });
     }
     else
     {
         MessageBox.Show(e.Exception.ToString(), "Nameserver exception");
     }
 }
예제 #22
0
파일: CacheEntry.cs 프로젝트: rmarinho/AgFx
 void LiveValueLoader_Failed(object s, ExceptionEventArgs e)
 {
     NotifyCompletion((ValueLoader)s, e.Exception);
 }
예제 #23
0
        void Connection_LostConnection(object sender, ExceptionEventArgs e)
        {
            if (LostConnection != null)
            {
                LostConnection(sender, e);
            }
            else
            {
                throw e.ThrownException;
            }

            OnConnectionLost(e.ThrownException);
        }
예제 #24
0
 private void _NameServerAuthenticationError(object sender, ExceptionEventArgs e)
 {
     Session.AddTextToChat(_NetworkChat, "-!- Authentication error: " + e.Exception.Message);
     _MsnClient.Disconnect();
 }
예제 #25
0
 private void directConnection_ConnectionException(object sender, ExceptionEventArgs e)
 {
     OnBridgeClosed(EventArgs.Empty);
 }
예제 #26
0
 private static void sender_Error(object sender, ExceptionEventArgs e)
 {
     if (e.Exception == null) return;
     Console.WriteLine();
     Console.WriteLine(e.Exception.Message);
     if (!e.ExceptionHandled)
     {
         _acDomain.LoggingService.Error(e.Exception);
     }
 }
예제 #27
0
 void _client_LostConnection(object sender, ExceptionEventArgs e)
 {
     SetupForConnection();
 }
예제 #28
0
 private void Nameserver_ExceptionOccurred(object sender, ExceptionEventArgs e)
 {
 }
예제 #29
0
        void Logger_Fault(object sender, ExceptionEventArgs e)
        {
            if (!CheckAccess())
            {
                Dispatcher.Invoke(new EventHandler<ExceptionEventArgs>(Logger_Fault), sender, e);
                return;
            }
            asmLbl.DataContext = new AsmData()
            {
                Assembly = null,
                Icon = (BitmapSource)FindResource("error"),
                Filename = "Failure!",
                Fullname = e.Exception is ThreadAbortException ? "Cancelled." : e.Exception.Message
            };
            if (e.Exception is ThreadAbortException)
            {
                log.AppendText("Cancelled!\r\n");
            }
            else if (
                e.Exception is SecurityException ||
                e.Exception is DirectoryNotFoundException ||
                e.Exception is UnauthorizedAccessException ||
                e.Exception is IOException)
            {
                log.AppendText("\r\n\r\n\r\n");
                log.AppendText("Oops... Confuser crashed...\r\n");
                log.AppendText("\r\n");
                log.AppendText(e.Exception.GetType().FullName + "\r\n");
                log.AppendText("Message : " + e.Exception.Message + "\r\n");
                log.AppendText("Stack Trace :\r\n");
                log.AppendText(e.Exception.StackTrace + "\r\n");
                log.AppendText("\r\n");
                log.AppendText("Please ensure Confuser have enough permission!!!\r\n");
            }
            else
            {
                log.AppendText("\r\n\r\n\r\n");
                log.AppendText("Oops... Confuser crashed...\r\n");
                log.AppendText("\r\n");
                log.AppendText(e.Exception.GetType().FullName + "\r\n");
                log.AppendText("Message : " + e.Exception.Message + "\r\n");
                log.AppendText("Stack Trace :\r\n");
                log.AppendText(e.Exception.StackTrace + "\r\n");
                log.AppendText("\r\n");
                log.AppendText("Please report it!!!\r\n");
            }

            cr = null;
            thread = null;
            btn.IsEnabled = false;
            host.EnabledNavigation = true;
            p = -1;
            Dispatcher.BeginInvoke(new Action(() => GC.Collect()), System.Windows.Threading.DispatcherPriority.SystemIdle);
        }
예제 #30
0
 private void OnError(ExceptionEventArgs e)
 {
     if (Error != null)
     {
         Error(this, e);
     }
 }
예제 #31
0
		/// <summary>
		/// Event fired when an exception is throw in the Validated event or in an editing method
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnEditException(ExceptionEventArgs e)
		{
#if DEBUG
			System.Diagnostics.Debug.WriteLine("Exception on editing cell: " + e.Exception.ToString());
#endif

			if (EditException!=null)
				EditException(this, e);
		}