Exemplo n.º 1
0
        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); }
        }
Exemplo n.º 2
0
Arquivo: BoSH.cs Projeto: qq1257/Hello
        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));
        }
Exemplo n.º 3
0
        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);
                }
            }
        }
Exemplo n.º 4
0
 private void PushEvent(ErrorType errorType, ErrorPolicyType policy) { OnEvent(new BackendEventError("", errorType, policy)); }
Exemplo n.º 5
0
 private void ConnectionError(ErrorType type, ErrorPolicyType policy, string cause = "")
 {
     CleanupState();
     _manager.Events.Error(this, type, policy, cause);
 }
Exemplo n.º 6
0
 public BackendEventError(string id, ErrorType errorType, ErrorPolicyType policy, string errorMessage = "") : base(id, EventType.Error)
 {
     Error = errorType; Policy = policy; Message = errorMessage;
 }
Exemplo n.º 7
0
 private void ConnectionError(ErrorType type, ErrorPolicyType policy, string cause = "")
 {
     CleanupState();
     _manager.Events.Error(this, type, policy, cause);
 }
Exemplo n.º 8
0
 public void Error(object sender, ErrorType type, ErrorPolicyType policy, string message = "")
 {
     Error(sender, new ErrorEventArgs(message, type, policy));
 }
Exemplo n.º 9
0
 public void Error(object sender, ErrorType type, ErrorPolicyType policy, string message = "") { Error(sender, new ErrorEventArgs(message, type, policy)); }
Exemplo n.º 10
0
 private void PushEvent(ErrorType errorType, ErrorPolicyType errorPolicy,  string message = "") { PushEvent(new BackendEventError(Id, errorType, errorPolicy, message)); }
Exemplo n.º 11
0
 private void PushEvent(ErrorType errorType, ErrorPolicyType errorPolicy, string message = "")
 {
     PushEvent(new BackendEventError(Id, errorType, errorPolicy, message));
 }
Exemplo n.º 12
0
 public BackendEventError(string id, ErrorType errorType, ErrorPolicyType policy, string errorMessage = "") : base(id, EventType.Error) { Error = errorType; Policy = policy; Message = errorMessage; }
Exemplo n.º 13
0
Arquivo: BoSH.cs Projeto: shyrat/xmpp
        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);
                }
            }
        }
Exemplo n.º 14
0
 public ErrorEventArgs(string message_, ErrorType type_, ErrorPolicyType policy_) { this.message = message_; this.type = type_; this.policy = policy_; }
Exemplo n.º 15
0
 public ErrorEventArgs(string message_, ErrorType type_, ErrorPolicyType policy_)
 {
     this.message = message_; this.type = type_; this.policy = policy_;
 }
Exemplo n.º 16
0
 public void Error(object sender, ErrorType type, ErrorPolicyType policy, string format, params object[] parameters) { Error(sender, type, policy, string.Format(format, parameters)); }
Exemplo n.º 17
0
 public void Error(object sender, ErrorType type, ErrorPolicyType policy, string format, params object[] parameters)
 {
     Error(sender, type, policy, string.Format(format, parameters));
 }
Exemplo n.º 18
0
 private void PushEvent(ErrorType errorType, ErrorPolicyType policy)
 {
     OnEvent(new BackendEventError("", errorType, policy));
 }
Exemplo n.º 19
0
        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); }
        }