public static void Handle(this NotificationException e, HttpActionExecutedContext context) { var response = BuildContent(e.Messages); response.StatusCode = HttpStatusCode.BadRequest; context.Response = response; }
public void OnError(NotificationException notificationException) { INotificationEvents notificationEventsHandler = connectResourceManager.GetNotificationEventHandler(); if (notificationEventsHandler != null) { notificationEventsHandler.OnError(notificationException); } }
protected void OnError(/*Context context, */ String errorId) { Log.Debug(typeof(NotificationService).Name, "onError", "Error caught, " + errorId); NotificationException notificationException = new NotificationException(typeof(NotificationException).Name, "onError", "Error caught: " + errorId); NotificationManager notificationManager = NotificationManager.GetInstance(); notificationManager.OnError(notificationException); }
public static void HandleOnDbError(object source, string serializedArgs) { dynamic dbEx = JsonConvert.DeserializeObject(serializedArgs); try { LogServiceAsync <CustomLogServiceOptions> .Instance.LogMessage(serializedArgs); NotificationException notification = dbEx.notification.ToObject <NotificationException>(); notification.Username = HttpContext.Current.User.Identity.Name; notification.RawMessage = serializedArgs; DefaultNotificationClient.Instance.Notify(notification); } catch { } }
public static void HandleOnExceptionLoggged(object source, string serializedArgs) { var logService = GlobalConfiguration.Configuration.DependencyResolver.GetService <ILogServiceAsync <ILogServiceSettings> >(); var notificationClient = GlobalConfiguration.Configuration.DependencyResolver.GetService <INotificationClient>(); logService.LogMessage(serializedArgs); if (notificationClient == null) { return; } dynamic unhandledException = JsonConvert.DeserializeObject(serializedArgs); NotificationException notification = unhandledException.notification.ToObject <NotificationException>(); notification.RawMessage = unhandledException; }
private static NotificationException createNotificationException(WebException ex) { NotificationException exception; if (ex.Status == WebExceptionStatus.ProtocolError) { var response = ex.Response as HttpWebResponse; if (response != null) { exception = new NotificationException((int)response.StatusCode, ex.Message); } else { exception = new NotificationException(ex.Message, ex); } } else { exception = new NotificationException(ex.Message, ex); } return(exception); }
public ItemFailedEventArgs(Guid id, NotificationException exception) { Id = id; Exception = exception; }
private void OnItemFailed(ReminderItem item, NotificationException exception) { _storage.Update(item.Failed()); ItemFailed?.Invoke(this, new ItemFailedEventArgs(item.Id, exception)); }
public ReminderFailedEventArgs(Guid id, NotificationException exception) { Id = id; Exception = exception; }