public void CreateError(ErrorPolicyType errorType, string account, string message, string details = "") { try { if (errorType != ErrorPolicyType.Informative || Frontend.Settings.showInformativeErrors) { var notification = new Notification(); notification.Account = account; notification.Type = NotificationType.Error; notification.Message = message; notification.Details = details; switch (errorType) { case ErrorPolicyType.Deactivate: { notification.Action = FlyoutType.AccountListEdit; break; } case ErrorPolicyType.Informative: { notification.Action = FlyoutType.None; break; } case ErrorPolicyType.Severe: { notification.Action = FlyoutType.None; break; } } notification.Data = null; AddNotification(notification); } } catch (Exception uiEx) { Frontend.UIError(uiEx); } }
private void ConnectionError(ErrorType type, ErrorPolicyType policy, string cause) { if (Interlocked.Read(ref _disconnecting) == 1L) { return; } if (Interlocked.CompareExchange(ref _connectionError, 1L, 0L) == 1L) { return; } Task.Run(() => _manager.Events.Error(this, type, policy, cause)); }
private void ConnectionError(ErrorType type, ErrorPolicyType policy, string cause, body body) { if (_disconnecting.IsSet) { return; } if (string.IsNullOrEmpty(body.sid) || Interlocked.Increment(ref _retryCounter) >= MaxRetry) { if (!_connectionError.IsSet) { _connectionError.Set(); _manager.Events.Error(this, type, policy, cause); } } else { foreach (var item in body.Elements()) { _tagQueue.Enqueue(item); } } }
private void PushEvent(ErrorType errorType, ErrorPolicyType policy) { OnEvent(new BackendEventError("", errorType, policy)); }
private void ConnectionError(ErrorType type, ErrorPolicyType policy, string cause = "") { CleanupState(); _manager.Events.Error(this, type, policy, cause); }
public BackendEventError(string id, ErrorType errorType, ErrorPolicyType policy, string errorMessage = "") : base(id, EventType.Error) { Error = errorType; Policy = policy; Message = errorMessage; }
public void Error(object sender, ErrorType type, ErrorPolicyType policy, string message = "") { Error(sender, new ErrorEventArgs(message, type, policy)); }
private void PushEvent(ErrorType errorType, ErrorPolicyType errorPolicy, string message = "") { PushEvent(new BackendEventError(Id, errorType, errorPolicy, message)); }
public ErrorEventArgs(string message_, ErrorType type_, ErrorPolicyType policy_) { this.message = message_; this.type = type_; this.policy = policy_; }
public void Error(object sender, ErrorType type, ErrorPolicyType policy, string format, params object[] parameters) { Error(sender, type, policy, string.Format(format, parameters)); }