GetException() public method

public GetException ( ) : System.Exception
return System.Exception
Example #1
0
        private static void ValidateErrorEventArgs(Exception exception)
        {
            ErrorEventArgs args = new ErrorEventArgs(exception);

            Assert.Equal(exception, args.GetException());

            // Make sure method is consistent.
            Assert.Equal(exception, args.GetException());
        }
Example #2
0
        private static void OnError(object sender, ErrorEventArgs e)
        {
            var exception = e.GetException();
            Console.Error.WriteLine($"Hit an Exception with HResult '{ exception.HResult }'" +
                Environment.NewLine +
                $"{ exception }");

            Environment.FailFast(exception.Message);
        }
 /// <summary>
 ///     Callback for <see cref="FileSystemWatcher" /> file error events.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnFileError(object sender, ErrorEventArgs e)
 {
     _tailActor.Tell(new TailActor.FileError(_fileNameOnly, e.GetException().Message), ActorRefs.NoSender);
 }
Example #4
0
        /// <summary>
        /// Handles the Error event of the watcher control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ErrorEventArgs" /> instance containing the event data.</param>
        async void watcher_Error(object sender, ErrorEventArgs e)
        {
            var ex = e.GetException();
            var dw = (FileSystemWatcher)sender;

            Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);

            //Network either dropped or, we are coming out of sleep and it hasn't reconnected yet - wait and retry
            var retries = 0;
            var success = false;
            while (!success && retries < 10)
            {
                await Task.Delay(500).ConfigureAwait(false);

                try
                {
                    dw.EnableRaisingEvents = false;
                    dw.EnableRaisingEvents = true;
                    success = true;
                }
                catch (ObjectDisposedException)
                {
                    RemoveWatcherFromList(dw);
                    return;
                }
                catch (IOException)
                {
                    Logger.Warn("Network still unavailable...");
                    retries++;
                }
                catch (ApplicationException)
                {
                    Logger.Warn("Network still unavailable...");
                    retries++;
                }
            }
            if (!success)
            {
                Logger.Warn("Unable to access network. Giving up.");
                DisposeWatcher(dw);
            }
        }
Example #5
0
 void onError(object sender, ErrorEventArgs e)
 {
     throw new Exception("{0}: File system watcher error {1}".format(_path, e.GetException().Message));
 }
Example #6
0
 private static void FileWatcherError(object sender, ErrorEventArgs e)
 {
     Console.WriteLine("File watcher exception: " + e.GetException().Message);
 }
 private static void SpoolWatcherError(Object sender, ErrorEventArgs e)
 {
     try
     {
         Logger.GetInstance().Error("Filewatcher error: " + e.GetException().Message + " restartting TempSpooler");
         Stop();
         Start();
     }
     catch (Exception ex)
     {
         Logger.GetInstance().Error("SpoolWatcherError Error:" + ex);
     }
 }
Example #8
0
 private void Error(object sender, ErrorEventArgs e)
 {
   Append("ERROR\t" + (e.GetException().Message));
 }
Example #9
0
 private void OnError(object sender, ErrorEventArgs e)
 {
     // Error event is raised when the directory being watched gets deleted
     // in cases when a parent to that directory is deleted, this handler should 
     // finish quickly so the deletion does not fail.
     HostingEnvironment.QueueBackgroundWorkItem(cancellationToken =>
     {
         Exception ex = e.GetException();
         _traceFactory.GetTracer().TraceError(ex.ToString());
         ResetWatcher();
     });
 }
        // Called when the file processor encounters an unexpected error.
        private static void FileProcessor_Error(object sender, ErrorEventArgs args)
        {
            Exception ex = args.GetException();

            if (ex is FileSkippedException)
                Log.Warn(ex.Message);
            else
                OnProcessException(args.GetException());
        }
Example #11
0
        private void OnError(object sender, ErrorEventArgs e)
        {
            e.GetException().ToExceptionless().Submit();

            if (InvokeRequired)
            {
                BeginInvoke(new ErrorEventHandler(OnError), sender, e);
                return;
            }

            MessageBox.Show(Constants.Messages.Error + e.GetException().InnerException,
                            Constants.Messages.ErrorCaption,
                            MessageBoxButtons.OK, MessageBoxIcon.Error);
            Console.WriteLine(Constants.Messages.Error + e.GetException().InnerException);
        }
 void controller_Errored(object sender, System.IO.ErrorEventArgs e)
 {
     MessageBox.Show(e.GetException().ToString(), I18N.GetString("Shadowsocks Error: {0}", e.GetException().Message));
 }
Example #13
0
 void controller_UpdatePACFromGFWListError(object sender, System.IO.ErrorEventArgs e)
 {
     ShowBalloonTip(I18N.GetString("Failed to update PAC file"), e.GetException().Message, ToolTipIcon.Error, 5000);
     logger.LogUsefulException(e.GetException());
 }
 private void FS_Error(object sender, System.IO.ErrorEventArgs e)
 {
     OnLog(String.Format("FileSystemWatcher Error {0}", e.GetException().Message));
 }
Example #15
0
        private void Target_Error(object sender, System.IO.ErrorEventArgs e)
        {
            this.error = e.GetException();

            this.waitHandle.Set();
        }
Example #16
0
        /// <summary>
        /// Handles the Error event of the watcher control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ErrorEventArgs" /> instance containing the event data.</param>
        void watcher_Error(object sender, ErrorEventArgs e)
        {
            var ex = e.GetException();
            var dw = (FileSystemWatcher)sender;

            Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);

            DisposeWatcher(dw);
        }
 private void PackReceived_Error(object sender, ErrorEventArgs e)
 {
     Terminal.Instance.Client.Notifier.Log(TraceLevel.Error, e.GetException().ToString());
 }
Example #18
0
        static void w_Error(object sender, ErrorEventArgs e) {
            var h = Program.WatchNotify;
            var ex = e.GetException();
            if (!(ex is System.IO.IOException)) {
                if (h != null) {
                    h(sender, new WatcherNotifyEventArgs(true, e.GetException()));
                } else {
                    Console.WriteLine("Error: {0} : {1}",
                                      e.GetException().GetType().Name,
                                      e.GetException().Message);

                }
            }
        }
 private void OnError(object sender, ErrorEventArgs e)
 {
     UiInvoke(() => TextBlockConsole.Text += "Errore di connessione \n");
     client.WSDisconnect();
     MessageBox.Show(e.GetException().Message);
 }
		void FileSystemWatcherError(object source, ErrorEventArgs e)
		{
			Console.WriteLine(e.GetException().ToString());
		}
 private void ConfirmedCommandConverter_Error(object sender, ErrorEventArgs e)
 {
     _tracer.TraceError(e.GetException());
 }
Example #22
0
 private void watcher_Error(object sender, ErrorEventArgs e)
 {
     Interface.Oxide.NextTick(() =>
     {
         Interface.Oxide.LogError("FSWatcher error: {0}", e.GetException());
         RemoteLogger.Exception("FSWatcher error", e.GetException());
     });
 }
Example #23
0
 private void GameManagerOnOnError(object sender, ErrorEventArgs errorEventArgs)
 {
     MessageBox.Show(errorEventArgs.GetException().ToString(), "Error creating game");
 }
Example #24
0
 void watcher_Error(object sender, ErrorEventArgs e)
 {
     MPTVSeriesLog.Write("File Watcher: Error event: " + e.GetException().Message);
     refreshWatchers = true;
 }
Example #25
0
 private void OnErrorDetected(object sender, ErrorEventArgs e)
 {
     OnError(e.GetException());
 }
Example #26
0
        static void OnError(object sender, ErrorEventArgs e)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            logger.InfoFormat("BEGIN: {0}()", methodName);
            try
            {
                
                logger.Error(e.GetException());
                if (e.GetException().GetType() == typeof(InternalBufferOverflowException))
                {
                   
                    watcher.EnableRaisingEvents = false;
                    logger.Debug("Set watcher.EnableRaisingEvents = false");
                    watcher.InternalBufferSize = _config.InternalBufferSize * 1024;
                    logger.Debug("Set watcher.InternalBufferSize = " +_config.InternalBufferSize.ToString()+ "K");
                    watcher.EnableRaisingEvents = true;
                    logger.Debug("Set watcher.EnableRaisingEvents = true");
                }
                else
                {
                   // logger.Debug("OnError Thread,  lock (timerlock) start...");
                    lock (timerlock)
                    {
                        _happenError = true;
                        if (!_timerEnable)
                        {
                            _timerEnable = true;
                            ThreadPool.QueueUserWorkItem(OnCheckDirWorker, e.GetException());
                            logger.Debug("Raise monitor Folder Thread!!");
                        }
                    }
                   // logger.Debug("OnError Thread,  lock (timerlock) end...");
                }
            }
            catch (Exception ex)
            {
                logger.Error(methodName, ex);

            }
            finally
            {
                logger.InfoFormat("END: {0}()", methodName);
            }
        }
Example #27
0
 void WatcherError(object sender, ErrorEventArgs e)
 {
     LogMyFilms.Debug("File Watcher: Error event: " + e.GetException().Message);
       refreshWatchers = true;
 }
Example #28
0
File: KfsShare.cs Project: tmbx/kwm
 /// <summary>
 /// Called when the watcher has failed.
 /// </summary>
 public void OnWatcherError(object sender, ErrorEventArgs e)
 {
     Logging.Log(2, "File system watcher error: " + e.GetException().Message + ".");
     OnScanFailed();
     Pipeline.Run("FsWatcher error'ed on us.", true);
 }
Example #29
0
        /// <summary>
        /// Handles the Error event of the watcher control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ErrorEventArgs" /> instance containing the event data.</param>
        void watcher_Error(object sender, ErrorEventArgs e)
        {
            var ex = e.GetException();
            var dw = (FileSystemWatcher)sender;

            Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);

            DisposeWatcher(dw);

            if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto)
            {
                Logger.Info("Disabling realtime monitor to prevent future instability");

                ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled;
                Stop();
            }
        }
Example #30
0
 void Server_FileSendError(object sender, ErrorEventArgs e)
 {
     PaperControl.Console_Color_WriteLine_Log("(FileSendError)" + e.GetException().Message, ConsoleColor.Red);
 }
 private void SocketExceptionHandler(object sender, ErrorEventArgs error)
 {
     MessageBox.Show("The connection to the spreadsheet has been lost.\nPlease try to join again.\n\n" + error.GetException().Message, "Connection Lost", MessageBoxButtons.OK, MessageBoxIcon.Error);
     CleanSpreadsheet();
 }
 void eh_OccurError(object sender, ErrorEventArgs e)
 {
     MessageBox.Show("匯出時發生錯誤! \n" + e.GetException(), "失敗", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Example #33
0
 /// Callback for errors in watcher
 protected void OnWatcherError(object source, ErrorEventArgs e)
 {
     Console.Error.WriteLine("*** {0}", e.GetException());
 }
Example #34
0
 void onError(object sender, ErrorEventArgs e)
 {
     dispatcherError(e.GetException());
 }
Example #35
0
		void fsw_Error(object sender, ErrorEventArgs e)
		{
			Exception err = e.GetException();
			// 当检测网络路径时,如果网络断开,则会爆 Code 为 64 的 Win32 异常
			if (err is System.ComponentModel.Win32Exception)
			{
				this.hasWin32Error = true;

				this.win32ErrorTime = DateTime.Now;

				XMS.Core.Container.LogService.Warn(
					String.Format("在监测“{0}”时 发生 Win32 错误,错误码为:{1},详细错误信息为:{2}"
					,this.fileOrDirectory, ((System.ComponentModel.Win32Exception)err).NativeErrorCode, ((System.ComponentModel.Win32Exception)err).Message)
					, Logging.LogCategory.Cache);
			}
			else // 经查看 FileSystemWatcher 的内部实现,基本上不会抛出其它类型的异常
			{
				XMS.Core.Container.LogService.Warn(
					String.Format("在监测“{0}”时 发生错误,详细错误信息为:{1}"
					, this.fileOrDirectory, err.Message)
					, Logging.LogCategory.Cache);
			}
		}
Example #36
0
 void fsw_Error(object sender, System.IO.ErrorEventArgs e)
 {
     if (LogEvent != null)
     {
         LogEvent(Classes.Enumerations.LoggingEnumerations.LogEventTypes.Information, "File Error " + e.GetException().Message);
     }
 }