private void ExceptionListener(object sender, ExceptionEventArgs e) { Console.WriteLine ("Exception handler called"); String message = e.Message; Console.WriteLine (message); }
/// <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); } }
/// <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; }
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; }
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; }
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); } } }
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); }
static void p_UnhandledException(object sender, ExceptionEventArgs e) { Console.WriteLine(e.Exception); }
private static void DefaultUnhandledExceptionHandler(object source, ExceptionEventArgs eventArgs) { Console.Error.WriteLine(eventArgs.Exception); }
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); } }
private void Nameserver_AuthenticationError(object sender, ExceptionEventArgs e) { }
private void NameserverProcessor_ConnectingException(object sender, ExceptionEventArgs e) { }
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); }
/// <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); } }
/// <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); } }
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"); } }
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"); } }
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"); } }
void LiveValueLoader_Failed(object s, ExceptionEventArgs e) { NotifyCompletion((ValueLoader)s, e.Exception); }
void Connection_LostConnection(object sender, ExceptionEventArgs e) { if (LostConnection != null) { LostConnection(sender, e); } else { throw e.ThrownException; } OnConnectionLost(e.ThrownException); }
private void _NameServerAuthenticationError(object sender, ExceptionEventArgs e) { Session.AddTextToChat(_NetworkChat, "-!- Authentication error: " + e.Exception.Message); _MsnClient.Disconnect(); }
private void directConnection_ConnectionException(object sender, ExceptionEventArgs e) { OnBridgeClosed(EventArgs.Empty); }
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); } }
void _client_LostConnection(object sender, ExceptionEventArgs e) { SetupForConnection(); }
private void Nameserver_ExceptionOccurred(object sender, ExceptionEventArgs e) { }
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); }
private void OnError(ExceptionEventArgs e) { if (Error != null) { Error(this, e); } }
/// <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); }