private static void HandleExceptionReceived(object sender, ExceptionReceivedEventArgs e) { if (e != null && e.Exception != null) { var queue = (string)sender; Logger.Info(string.Format(CultureInfo.InvariantCulture, "Exception occurred on queue {0}.", queue), e.Exception); } }
void LogErrors(object sender, ExceptionReceivedEventArgs e) { if (e.Exception != null) { Console.WriteLine("Error: " + e.Exception.Message); // Client.Close(); } }
public void Run() { var args = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString()); var queue = Substitute.For<IBusQueueReciever>(); queue.RegisterForEvents(Arg.Any<Func<BrokeredMessage, Task>>(), Arg.Any<OnMessageOptions>()); var handler = Substitute.For<IBusEventHandler<object>>(); var events = new BusEvents<object>(queue, handler); events.Run(); queue.Received().RegisterForEvents(Arg.Any<Func<BrokeredMessage, Task>>(), Arg.Any<OnMessageOptions>()); }
/// <summary> /// Event handler for each time an error occurs. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void OnExceptionReceived(object sender, ExceptionReceivedEventArgs e) { if (e?.Exception != null) { Console.WriteLine(" > Exception received: {0}", e.Exception.Message); return; } Console.WriteLine(" > {0} - Exception received: null", DateTime.Now); }
private static Task ExceptionHandler(ExceptionReceivedEventArgs args) { Console.WriteLine($"Exception received:{args.Exception.Message}"); return(Task.CompletedTask); }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs args) { _logger.LogError(args.Exception, "ExceptionReceivedHandler triggered"); return(Task.CompletedTask); }
private static Task unhappypath(ExceptionReceivedEventArgs arg) { throw new NotImplementedException(); }
private void OnExceptionReceived(object sender, ExceptionReceivedEventArgs e) { Trace.TraceError("An exception occured while trying to receive a message from the '{0}' Service Bus Topic", _globalSettings.DiscoTopicName); }
void options_ExceptionReceived(object sender, ExceptionReceivedEventArgs ex) { if (!data.CancelToken.IsCancellationRequested && typeof(ThreadAbortException) != ex.GetType()) { //The subscription may have been deleted. If it was, then we want to recreate it. var subException = ex.Exception as MessagingEntityNotFoundException; if (subException != null && subException.Detail != null && subException.Detail.Message.IndexOf("40400") > -1) { logger.Info("Subscription was deleted. Attempting to Recreate."); Configure(endpoint); data.Client.OnMessage(OnMessageHandler, options); logger.Info("Subscription was deleted. Recreated."); } else { logger.Error(string.Format("ProcessMessagesForSubscription Message Error={0} Declared={1} MessageTytpe={2} IsReusable={3} Error={4}", data.EndPointData.SubscriptionName, data.EndPointData.DeclaredType.ToString(), data.EndPointData.MessageType.ToString(), data.EndPointData.IsReusable, ex.ToString())); } } else { //data.SetMessageLoopCompleted(); } //TODO do something with the error we just received. logger.Error("Message Pump Error: Start {0} Declared {1} MessageTytpe {2}, Error {3}", data.EndPointData.SubscriptionName, data.EndPointData.DeclaredType.ToString(), data.EndPointData.MessageType.ToString(), ex.Exception.ToString()); }
private void EventProcessorOptionsOnExceptionReceived(object sender, ExceptionReceivedEventArgs exceptionReceivedEventArgs) { var message = String.Format("Exception from EventProcessorHost, Action was: {0}.", exceptionReceivedEventArgs.Action); ErrorLogging(message, exceptionReceivedEventArgs.Exception); }
private static async Task ExceptionReceivedHandler(ExceptionReceivedEventArgs arg) { throw new NotImplementedException(); }
private async Task ExceptionReceivedHandler(ExceptionReceivedEventArgs arg) { await _unitOfWork.LogRepository.SaveAsync(arg.Exception.ToString()); }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs args) { ExceptionHandler?.Invoke(args); return(Task.CompletedTask); }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { _logger.LogError(exceptionReceivedEventArgs.Exception, exceptionReceivedEventArgs.Exception.Message); return(Task.CompletedTask); }
public void ExceptionReceived(object sender, ExceptionReceivedEventArgs args) { this.logger.ErrorWrite(args.Exception); }
public void OnExceptionReceived() { var args = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString()); var queue = Substitute.For<IBusQueueReciever>(); var handler = Substitute.For<IBusEventHandler<object>>(); handler.OnError(args.Action, args.Exception); var events = new BusEvents<object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received().OnError(args.Action, args.Exception); }
/// <summary> /// Excetion handler /// </summary> /// <param name="exceptionReceivedEventArgs"></param> /// <returns></returns> private async Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { await subscriptionClient.AbandonAsync($"{ReceiveMode.PeekLock}"); throw exceptionReceivedEventArgs.Exception; }
private Task LogMessageHandlerException(ExceptionReceivedEventArgs e) { Console.WriteLine("Exception: \"{0}\" {1}", e.Exception.Message, e.ExceptionReceivedContext.EntityPath); return(Task.CompletedTask); }
Task ExceptionReceivedHandler(ExceptionReceivedEventArgs eventArgs) { TestUtility.Log($"Exception Received: ClientId: {eventArgs.ExceptionReceivedContext.ClientId}, EntityPath: {eventArgs.ExceptionReceivedContext.EntityPath}, Exception: {eventArgs.Exception.Message}"); return(Task.CompletedTask); }
private Task HandleMessagingExceptionAsync(ExceptionReceivedEventArgs eventArgs) { // TODO: Log this exception. return(Task.CompletedTask); }
public void OnExceptionReceivedExceptionNull() { var args = new ExceptionReceivedEventArgs(null, Guid.NewGuid().ToString()); var queue = Substitute.For<IBusQueueReciever>(); var handler = Substitute.For<IBusEventHandler<object>>(); handler.OnError(Arg.Any<string>(), Arg.Any<Exception>()); var events = new BusEvents<object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received(0).OnError(Arg.Any<string>(), Arg.Any<Exception>()); }
private static Task HandleException(ExceptionReceivedEventArgs args) { Console.WriteLine(args.Exception + ", stack trace: " + args.Exception.StackTrace); return(Task.CompletedTask); }
private void LogErrors(object sender, ExceptionReceivedEventArgs e) { if (e.Exception == null || e.Exception is OperationCanceledException) { return; } HandleException(e.Exception); }
private void OptionsOnExceptionReceived(object sender, ExceptionReceivedEventArgs exceptionReceivedEventArgs) { //There is currently an issue in the Service Bus SDK that raises a null exception if (exceptionReceivedEventArgs.Exception != null) { Trace.TraceError("Exception in QueueClient.ExceptionReceived: {0}", exceptionReceivedEventArgs.Exception.Message); } }
void OptionsOnExceptionReceived(object sender, ExceptionReceivedEventArgs exceptionReceivedEventArgs) { Trace.TraceError("Received exception, action: {0}, message: {1}", exceptionReceivedEventArgs.Action, exceptionReceivedEventArgs.Exception.ToString()); }
private void MessageExceptionReceived(object sender, ExceptionReceivedEventArgs e) { Trace.TraceError(e.Exception.Message); }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs arg) { logger.LogError($"Error receiving reliable events notification. Details: {arg.Exception}."); return(Task.CompletedTask); }
private Task HandleMessageExceptions(ExceptionReceivedEventArgs arg) { _logger.LogError(arg.Exception, "Error."); return(Task.CompletedTask); }
// Use this Handler to look at the exceptions received on the MessagePump static Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { Console.WriteLine($"Exception:: {exceptionReceivedEventArgs.Exception}."); return(Task.CompletedTask); }
private static Task ExceptionHandler(ExceptionReceivedEventArgs arg) { Console.WriteLine("Something bad happened!"); return(Task.CompletedTask); }
// Use this Handler to look at the exceptions received on the MessagePump static Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { Console.WriteLine($" Message handler encountered an exception {exceptionReceivedEventArgs.Exception}."); return(Task.CompletedTask); }
private async Task ProcessMessageExceptionInternalAsync(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { logger.LogError(exceptionReceivedEventArgs.Exception, "Message processing internal exception: queueName={queueName}", QueueName); await Task.CompletedTask; }
private Task ProcessMessageExceptionAsync(ExceptionReceivedEventArgs exceptionEvent) { _logger.LogError(exceptionEvent.Exception, "Exception processing message"); return(Task.CompletedTask); }
private static Task HandlerExceptionsAsync(ExceptionReceivedEventArgs arg) { throw new NotImplementedException(); }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs eventArgs) { return(Task.CompletedTask); }
/// <summary> /// Called when a processor exception is received. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="args"> /// The <see cref="ExceptionReceivedEventArgs"/> instance containing the event /// data. /// </param> private void OnProcessorExceptionReceived(object sender, ExceptionReceivedEventArgs args) { ActivityMonitor.Instance.ReportSubscriberException(this, args.Exception, false); }
private static async Task ExceptionReceivedHandlerAsync(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { var exception = exceptionReceivedEventArgs.Exception; await Task.CompletedTask; }
/// <summary> /// Process a recieved exception from the SubscriptionClient /// </summary> /// <param name="sender">Sending Object</param> /// <param name="e">Event Arguments</param> protected virtual void ProcessExceptionRecieved(object sender, ExceptionReceivedEventArgs e) { // TODO: Audit exceptions here. }
/// <summary> /// Logs the error and continues. /// </summary> /// <param name="args"></param> /// <returns></returns> protected virtual Task ExceptionReceivedHandler(ExceptionReceivedEventArgs args) { WriteLog($"There was an error while receiving a message: {args.Exception.Message}"); return(Task.CompletedTask); }
private static void EventProcessorOptions_ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { if (e?.Exception == null) { return; } // Trace Exception ServiceEventSource.Current.Message($"Exception=[{e.Exception.Message}] InnerException=[{e.Exception.InnerException?.Message ?? string.Empty}]"); }
private void OptionsOnExceptionReceived(object sender, ExceptionReceivedEventArgs exceptionReceivedEventArgs) { var exceptionMessage = "null"; if (exceptionReceivedEventArgs != null && exceptionReceivedEventArgs.Exception != null) { exceptionMessage = exceptionReceivedEventArgs.Exception.Message; Trace.TraceError("Exception in QueueClient.ExceptionReceived: {0}", exceptionMessage); } }
// Use this Handler to look at the exceptions received on the MessagePump Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) { this.EventLog.WriteEntry($"Message handler encountered an exception {exceptionReceivedEventArgs.Exception}.", EventLogEntryType.Error); return(Task.CompletedTask); }
private void Options_ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { throw new NotImplementedException(); }
private static Task ExceptionReceivedHandler(ExceptionReceivedEventArgs arg) { //throw new NotImplementedException(); return(null); }
private Task LogException(ExceptionReceivedEventArgs args) { _logger.LogError(args.Exception, args.Exception.Message); return(Task.CompletedTask); }
public Task HandleException(ExceptionReceivedEventArgs args) => Task.CompletedTask;
public static void ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { Trace.TraceError("Exception received from EventHostProcessor: {0} - {1}, {2}", e.Exception, e.Action, sender); }
private Task LogMessageHandlerException(ExceptionReceivedEventArgs e) { _logger.LogCritical(e.Exception, e.Exception.Message); return(Task.CompletedTask); }
private static void Options_ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { Debug.WriteLine(string.Format("Received exception, action: {0}, message: {1}.", e.Action, e.Exception.Message)); }
private void EventProcessorOptions_ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { if (e?.Exception != null) { WriteToLog(e.Exception.Message); } }
/// <summary> /// Receive and log callback exceptions from the event host processor /// </summary> private void options_ExceptionReceived(object sender, ExceptionReceivedEventArgs e) { Logger.Error(e.Exception, "Error on message processing, action {0}", e.Action); }