Ejemplo n.º 1
0
 public static void LogException(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
 {
     try
     {
         switch(exceptionSeverity)
         {
             case ExceptionSeverity.FatalException:
             case ExceptionSeverity.ErrorException:
                 ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Red);
                 Trace.TraceError(string.Format("{0} [{1}]", exception.Message, CreateString(exception.Data)));
                 RegisterExceptionAsync(exception, visibleToUser, exceptionSeverity);
                 break;
             case ExceptionSeverity.WarningException:
                 ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Yellow);
                 Trace.TraceError(string.Format("{0} [{1}]", exception.Message, CreateString(exception.Data)));
                 RegisterExceptionAsync(exception, visibleToUser, exceptionSeverity);
                 break;
             case ExceptionSeverity.InformationException:
                 if (IsInDebugMode())
                 {
                     ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Cyan);
                     Trace.TraceInformation(exception.Message);
                 }
                 break;
             default:
                 throw new ArgumentOutOfRangeException(string.Format("Unknown exception severity {0}.", exceptionSeverity));
         }
     }
     catch (Exception exp)
     {
         ShowMessage(exp.Message, ConsoleColor.DarkMagenta);
     }
 }
 // ReSharper disable TooManyDependencies
 public WarewolfException(string message, Exception innerException, ExceptionType exceptionType, ExceptionSeverity severity) :
     base(message, innerException ?? new Exception())
     // ReSharper restore TooManyDependencies
 {
     Severity      = severity;
     ExceptionType = exceptionType;
 }
Ejemplo n.º 3
0
        public WarewolfException(string message, Exception innerException, ExceptionType exceptionType, ExceptionSeverity severity) :
            base(message, innerException ?? new Exception())

        {
            Severity      = severity;
            ExceptionType = exceptionType;
        }
Ejemplo n.º 4
0
        public void Log(string msg, ExceptionSeverity severity)
        {
            switch (severity)
            {
            case ExceptionSeverity.Info:
                Info(msg);
                break;

            case ExceptionSeverity.Warn:
                Warn(msg);
                break;

            case ExceptionSeverity.Error:
                Error(msg);
                break;

            case ExceptionSeverity.Fatal:
                Fatal(msg);
                break;

            default:
                Error(msg);
                break;
            }
        }
Ejemplo n.º 5
0
        public void ThrowException(string message, ExceptionSeverity severity = ExceptionSeverity.Warning, params string[] values)
        {
            string         mess = string.Format(message, values);
            LinksException ex   = new LinksException(mess, severity);

            // TODO: send an email if error
            throw ex;
        }
 public RegistrationException(
     string message,
     Exception innerException   = null,
     ExceptionSeverity severity = DEFAULT_EXCEPTION_SEVERITY)
     : base(message, innerException)
 {
     Severity = severity;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets the message value.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="methodName">Name of the method.</param>
 /// <param name="id">The id.</param>
 /// <param name="severity">The severity.</param>
 public void SetMessageValue(System.Type type, string methodName, string id, ExceptionSeverity severity)
 {
     this.assemblyName = type.Assembly.FullName;
     this.className    = type.Name;
     this.severity     = severity;
     this.methodName   = methodName;
     this.id           = id;
 }
Ejemplo n.º 8
0
        public LogMessage SaveLogMessage2Db(ExceptionSeverity severity, string message)
        {
            LogMessage log = new LogMessage();

            log.ExceptionSeverityId = severity;
            log.Message             = message;

            db.Logs.Add(log);
            db.SaveChanges();

            return(log);
        }
Ejemplo n.º 9
0
        public void LogException(Exception exception, ExceptionSeverity severity)
        {
            switch (severity)
            {
            case ExceptionSeverity.Severe:
                serilogLogger.Fatal(exception, string.Empty);
                break;

            default:
                serilogLogger.Error(exception, string.Empty);
                break;
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Clear
 /// initializes or reinitializes all member variables.
 /// </summary>
 public void Clear()
 {
     this.assemblyName = String.Empty;
     //this.resourceNamePrefix = "HighJump.AdvantagePlatform.Tools.AdvArch.Model.Core.";  //TODO DELETE THIS
     this.className        = String.Empty;
     this.detailMessage    = String.Empty;
     this.detailParameters = new StringBuilder();
     this.id         = String.Empty;
     this.methodName = String.Empty;
     //this.modelAssembly = Assembly.GetAssembly( typeof( MessagePacket ) );  //TODO DELETE THIS
     this.severity          = ExceptionSeverity.Informational;
     this.summaryMessage    = String.Empty;
     this.summaryParameters = new StringBuilder();
     this.thrownBy          = new StringBuilder();
 }
Ejemplo n.º 11
0
        public static MagickException CreateException(IntPtr exception)
        {
            ExceptionSeverity severity    = (ExceptionSeverity)NativeMagickExceptionHelper.Severity(exception);
            string            message     = NativeMagickExceptionHelper.Message(exception);
            string            description = NativeMagickExceptionHelper.Description(exception);

            if (!string.IsNullOrEmpty(description))
            {
                message += " (" + description + ")";
            }

            List <MagickException> innerExceptions = CreateRelatedExceptions(exception);

            MagickException result = Create(severity, message);

            result.SetRelatedException(innerExceptions);

            return(result);
        }
Ejemplo n.º 12
0
        public static void LogException(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
        {
            try
            {
                switch (exceptionSeverity)
                {
                case ExceptionSeverity.FatalException:
                case ExceptionSeverity.ErrorException:
                    ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Red);
                    Trace.TraceError(string.Format("{0} [{1}]", exception.Message, CreateString(exception.Data)));
                    RegisterExceptionAsync(exception, visibleToUser, exceptionSeverity);
                    break;

                case ExceptionSeverity.WarningException:
                    ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Yellow);
                    Trace.TraceError(string.Format("{0} [{1}]", exception.Message, CreateString(exception.Data)));
                    RegisterExceptionAsync(exception, visibleToUser, exceptionSeverity);
                    break;

                case ExceptionSeverity.InformationException:
                    if (IsInDebugMode())
                    {
                        ShowMessage(string.Format("{0}: {1}", exceptionSeverity, exception.Message), ConsoleColor.Cyan);
                        Trace.TraceInformation(exception.Message);
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(string.Format("Unknown exception severity {0}.", exceptionSeverity));
                }
            }
            catch (Exception exp)
            {
                ShowMessage(exp.Message, ConsoleColor.DarkMagenta);
            }
        }
Ejemplo n.º 13
0
 public EMMAReportingException(ExceptionSeverity severity, string message)
     : base(severity, message)
 {
 }
Ejemplo n.º 14
0
 public EMMASettingsException(ExceptionSeverity severity, string message)
     : base(severity, message)
 {
 }
Ejemplo n.º 15
0
 public LinksException(int code, string message, ExceptionSeverity severity) : base(message)
 {
     this.severity = severity;
     this.code     = code;
 }
Ejemplo n.º 16
0
 public EMMAReportingException(ExceptionSeverity severity)
     : base(severity, "Error in EMMA's reporting sub-system")
 {
 }
 public SapphireDbException(string message, ExceptionSeverity severity = ExceptionSeverity.Warning) : base(message)
 {
     Severity = severity;
 }
Ejemplo n.º 18
0
 public EMMAException(ExceptionSeverity severity, string message, bool writeToLog)
     : base(message)
 {
     this.severity = severity;
     if (writeToLog) { WriteToLog(); }
 }
Ejemplo n.º 19
0
        private static void RegisterExceptionAsync(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
        {
            var registerExceptionTask = new Task(() => RegisterExceptionEx(exception, visibleToUser, exceptionSeverity));

            registerExceptionTask.Start();
        }
 /// <summary>
 /// Invalid access token exception with a custom message and a custom severity.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exceptionSeverity"></param>
 public InvalidAccessTokenException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }
Ejemplo n.º 21
0
 private static void RegisterExceptionAsync(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
 {
     var registerExceptionTask = new Task(() => RegisterExceptionEx(exception, visibleToUser, exceptionSeverity));
     registerExceptionTask.Start();
 }
Ejemplo n.º 22
0
 private static void RegisterExceptionEx(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
 {
     try
     {
         EnsureSessionEx();
         Debug.WriteLine("Provide {0} to tharga.support service when possible.", exceptionSeverity);
         Issue.Register(exception, visibleToUser);
     }
     catch (Exception exp)
     {
         Trace.TraceError(string.Format("Cannot register exception using tharga.support. {0}", exp.Message));
     }
 }
Ejemplo n.º 23
0
 private static void RegisterExceptionEx(Exception exception, bool visibleToUser, ExceptionSeverity exceptionSeverity)
 {
     try
     {
         EnsureSessionEx();
         Debug.WriteLine("Provide {0} to tharga.support service when possible.", exceptionSeverity);
         Issue.Register(exception, visibleToUser);
     }
     catch (Exception exp)
     {
         Trace.TraceError(string.Format("Cannot register exception using tharga.support. {0}", exp.Message));
     }
 }
 /// <summary>
 /// Forbidden exception with a custom message and a custom severity.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exceptionSeverity"></param>
 public ForbiddenException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }
 /// <summary>
 /// Invalid data exception with a custom message and custom severity.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exceptionSeverity"></param>
 public InvalidDataException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }
Ejemplo n.º 26
0
 public EMMADataException(ExceptionSeverity severity, string message)
     : base(severity, message)
 {
 }
 public SapphireDbException(string message, Exception innerException, ExceptionSeverity severity = ExceptionSeverity.Error) : base(message, innerException)
 {
     Severity = severity;
 }
Ejemplo n.º 28
0
 public EMMADataMissingException(ExceptionSeverity severity, string tableName, string key)
     : base(severity, "Data is missing from EMMA's database")
 {
     this.tableName = tableName;
     this.key = key;
 }
Ejemplo n.º 29
0
        /// <summary>
        /// Submit an exception to exceptron Servers.
        /// </summary>
        /// <param name="exception">Exception that is being reported</param>
        /// <param name="component" 
        /// example="DataAccess, Configuration, Registration, etc." 
        /// remarks="It is common to use the logger name that was used to log the exception as the component.">Component that experienced this exception.</param>

        /// <param name="severity">Severity of the exception being reported</param>
        /// <param name="message" 
        /// example="Something went wrong while checking for application updates.">Any message that should be attached to this exceptions</param>
        /// <param name="userId"
        /// remarks="This Id does not have to be tied to the user's identity. 
        /// You can use a system generated unique ID such as GUID. 
        /// This field is used to report how many unique users are experiencing an error." 
        /// example="
        /// 62E5C8EF-0CA2-43AB-B278-FC6994F776ED
        /// [email protected]
        /// 26437
        /// ">ID that will uniquely identify the user</param>
        /// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
        /// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
        /// <returns></returns>
        public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null)
        {
            var exceptionData = new ExceptionData
                                    {
                                        Exception = exception,
                                        Component = component,
                                        Severity = severity,
                                        Message = message,
                                        UserId = userId
                                    };

            return SubmitException(exceptionData);
        }
Ejemplo n.º 30
0
 private ExceptionNotification(string message, Exception exception, ExceptionSeverity severity)
 {
     Message   = message;
     Exception = exception;
     Severity  = severity;
 }
Ejemplo n.º 31
0
 public EMMAInvalidPasswordException(ExceptionSeverity severity)
     : base(severity, "Invalid password entered")
 {
 }
Ejemplo n.º 32
0
 public EMMAException(ExceptionSeverity severity, string message, Exception inner)
     : base(message, inner)
 {
     this.severity = severity;
     WriteToLog();
 }
Ejemplo n.º 33
0
 public EMMALicensingException(ExceptionSeverity severity)
     : base(severity, "Licensing problem")
 {
 }
Ejemplo n.º 34
0
 public EMMACompressionException(ExceptionSeverity severity)
     : base(severity, "Error in EMMA's file compression sub-system")
 {
 }
Ejemplo n.º 35
0
 public LinksException(string message, ExceptionSeverity severity) : base(message)
 {
     this.severity = severity;
 }
Ejemplo n.º 36
0
 public EMMAInvalidPasswordException(ExceptionSeverity severity, string message, Exception inner)
     : base(severity, message, inner)
 {
 }
 protected DataAccessLayerException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }
Ejemplo n.º 38
0
 public EMMALicensingException(ExceptionSeverity severity, string message)
     : base(severity, message)
 {
 }
Ejemplo n.º 39
0
 public WebApiException(string errorText, ExceptionSeverity severity)
 {
     ErrorText = errorText;
     Severity  = severity;
 }
Ejemplo n.º 40
0
 public EMMACompressionException(ExceptionSeverity severity, string message, Exception inner)
     : base(severity, message, inner)
 {
 }
Ejemplo n.º 41
0
        private static MagickException Create(ExceptionSeverity severity, string message)
        {
            switch (severity)
            {
            case ExceptionSeverity.BlobWarning:
                return(new MagickBlobWarningException(message));

            case ExceptionSeverity.CacheWarning:
                return(new MagickCacheWarningException(message));

            case ExceptionSeverity.CoderWarning:
                return(new MagickCoderWarningException(message));

            case ExceptionSeverity.ConfigureWarning:
                return(new MagickConfigureWarningException(message));

            case ExceptionSeverity.CorruptImageWarning:
                return(new MagickCorruptImageWarningException(message));

            case ExceptionSeverity.DelegateWarning:
                return(new MagickDelegateWarningException(message));

            case ExceptionSeverity.DrawWarning:
                return(new MagickDrawWarningException(message));

            case ExceptionSeverity.FileOpenWarning:
                return(new MagickFileOpenWarningException(message));

            case ExceptionSeverity.ImageWarning:
                return(new MagickImageWarningException(message));

            case ExceptionSeverity.MissingDelegateWarning:
                return(new MagickMissingDelegateWarningException(message));

            case ExceptionSeverity.ModuleWarning:
                return(new MagickModuleWarningException(message));

            case ExceptionSeverity.OptionWarning:
                return(new MagickOptionWarningException(message));

            case ExceptionSeverity.PolicyWarning:
                return(new MagickPolicyWarningException(message));

            case ExceptionSeverity.RegistryWarning:
                return(new MagickRegistryWarningException(message));

            case ExceptionSeverity.ResourceLimitWarning:
                return(new MagickResourceLimitWarningException(message));

            case ExceptionSeverity.StreamWarning:
                return(new MagickStreamWarningException(message));

            case ExceptionSeverity.TypeWarning:
                return(new MagickTypeWarningException(message));

            case ExceptionSeverity.BlobError:
                return(new MagickBlobErrorException(message));

            case ExceptionSeverity.CacheError:
                return(new MagickCacheErrorException(message));

            case ExceptionSeverity.CoderError:
                return(new MagickCoderErrorException(message));

            case ExceptionSeverity.ConfigureError:
                return(new MagickConfigureErrorException(message));

            case ExceptionSeverity.CorruptImageError:
                return(new MagickCorruptImageErrorException(message));

            case ExceptionSeverity.DelegateError:
                return(new MagickDelegateErrorException(message));

            case ExceptionSeverity.DrawError:
                return(new MagickDrawErrorException(message));

            case ExceptionSeverity.FileOpenError:
                return(new MagickFileOpenErrorException(message));

            case ExceptionSeverity.ImageError:
                return(new MagickImageErrorException(message));

            case ExceptionSeverity.MissingDelegateError:
                return(new MagickMissingDelegateErrorException(message));

            case ExceptionSeverity.ModuleError:
                return(new MagickModuleErrorException(message));

            case ExceptionSeverity.OptionError:
                return(new MagickOptionErrorException(message));

            case ExceptionSeverity.PolicyError:
                return(new MagickPolicyErrorException(message));

            case ExceptionSeverity.RegistryError:
                return(new MagickRegistryErrorException(message));

            case ExceptionSeverity.ResourceLimitError:
                return(new MagickResourceLimitErrorException(message));

            case ExceptionSeverity.StreamError:
                return(new MagickStreamErrorException(message));

            case ExceptionSeverity.TypeError:
                return(new MagickTypeErrorException(message));

            default:
                if (severity < ExceptionSeverity.Error)
                {
                    return(new MagickWarningException(message));
                }
                else
                {
                    return(new MagickErrorException(message));
                }
            }
        }
Ejemplo n.º 42
0
 public EMMASettingsException(ExceptionSeverity severity)
     : base(severity, "Error in EMMA's settings sub-system")
 {
 }
Ejemplo n.º 43
0
        /// <summary>
        /// Show an exception dialog of varying severity:
        /// ExceptionSeverity.Warning
        ///     Does not abort the program
        ///     Buttons: [Ok]
        /// ExceptionSeverity.Error
        ///     A (possibly expected) error that can be recovered from.
        ///     Buttons: [Debug] [Ignore] [Abort]
        /// ExceptionSeverity.Unhandled
        ///     An unexpected/unhandled exception, probably caught by the global exception handler function.
        ///     The exception can still be ignored, but this may lead to abnormal program operation.
        ///     Buttons: [Debug] [Ignore] [Abort]
        /// ExceptionSeverity.Critical
        ///     An unrecoverable error - user can only abort the program
        ///     Buttons: [Debug] [Abort]
        /// </summary>
        /// <param name="message">The message to present to the user</param>
        /// <param name="ex">The exception that caused this message to appear (optional)</param>
        /// <param name="severity">The severity of the exception</param>
        /// <returns>The button that was clicked</returns>
        public static ModalResult ShowException(string message, Exception ex = null, ExceptionSeverity severity = ExceptionSeverity.Error)
        {
            var fm = new ExceptionDialog();

            fm.messageLabel.Text = (message != null) ? message : "";

            if (ex != null)
            {
                if (message != null)
                {
                    fm.messageLabel.Text += "\n\nDetail:\n";
                }
                fm.messageLabel.Text += ex.Message;

                fm.detailsLabel.Text = "Exception Details:\n\n" + BuildExceptionDetails(ex);
            }
            else
            {
                fm.detailsGrid.Visibility    = Visibility.Hidden;
                fm.btnShowDetails.Visibility = Visibility.Hidden;
            }

            fm.Title = "HexLight Controller";
            switch (severity)
            {
            case ExceptionSeverity.Critical:
                fm.btnIgnore.Visibility = Visibility.Collapsed;
                fm.btnDebug.Visibility  = Visibility.Collapsed;
                fm.btnOk.Visibility     = Visibility.Collapsed;
                fm.btnAbort.IsCancel    = true;
                fm.btnAbort.IsDefault   = true;
                fm.Title += " - Critical Error";
                break;

            case ExceptionSeverity.Unhandled:
                fm.btnOk.Visibility   = Visibility.Collapsed;
                fm.btnAbort.IsCancel  = true;
                fm.btnAbort.IsDefault = true;
                fm.Title += " - Unhandled Exception";
                break;

            case ExceptionSeverity.Error:
                fm.btnOk.Visibility = Visibility.Collapsed;
                //fm.btnAbort.Visibility = Visibility.Collapsed;
                fm.btnIgnore.IsCancel  = true;
                fm.btnIgnore.IsDefault = true;
                fm.Title += " - Error";
                break;

            case ExceptionSeverity.Warning:
                fm.btnDebug.Visibility  = Visibility.Collapsed;
                fm.btnAbort.Visibility  = Visibility.Collapsed;
                fm.btnIgnore.Visibility = Visibility.Collapsed;
                fm.btnOk.IsCancel       = true;
                fm.btnOk.IsDefault      = true;
                fm.Title += " - Error";
                break;
            }

            fm.ShowDialog();

            // Shutdown the app if required
            if (severity == ExceptionSeverity.Critical || fm.modalResult == ModalResult.Abort)
            {
                Application.Current.Shutdown(1);
                System.Environment.Exit(1);
                return(fm.modalResult);
            }

            if (fm.modalResult == ModalResult.Debug)
            {
                Debugger.Launch();
                Debugger.Break();

                // Welcome, you have been brought here from the [Debug] button.
                // Where to from here?
                // - Try stepping out to see what caused the exception
                // - Examin the stack traces to see what caused the exception
            }

            return(fm.modalResult);
        }
Ejemplo n.º 44
0
 public EMMADataException(ExceptionSeverity severity)
     : base(severity, "Error in EMMA's database sub-system")
 {
 }
Ejemplo n.º 45
0
 /// <summary>
 /// Too many requests exception with a custom message and custom severity.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exceptionSeverity"></param>
 public TooManyRequestsException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }
Ejemplo n.º 46
0
 public EMMADataException(ExceptionSeverity severity, string message, Exception inner)
     : base(severity, message, inner)
 {
 }
Ejemplo n.º 47
0
 private static MagickException Create(ExceptionSeverity severity, string message, MagickException innerExceptions)
 {
   switch (severity)
   {
     case ExceptionSeverity.BlobWarning:
       return new MagickBlobWarningException(message, innerExceptions);
     case ExceptionSeverity.CacheWarning:
       return new MagickCacheWarningException(message, innerExceptions);
     case ExceptionSeverity.CoderWarning:
       return new MagickCoderWarningException(message, innerExceptions);
     case ExceptionSeverity.ConfigureWarning:
       return new MagickConfigureWarningException(message, innerExceptions);
     case ExceptionSeverity.CorruptImageWarning:
       return new MagickCorruptImageWarningException(message, innerExceptions);
     case ExceptionSeverity.DelegateWarning:
       return new MagickDelegateWarningException(message, innerExceptions);
     case ExceptionSeverity.DrawWarning:
       return new MagickDrawWarningException(message, innerExceptions);
     case ExceptionSeverity.FileOpenWarning:
       return new MagickFileOpenWarningException(message, innerExceptions);
     case ExceptionSeverity.ImageWarning:
       return new MagickImageWarningException(message, innerExceptions);
     case ExceptionSeverity.MissingDelegateWarning:
       return new MagickMissingDelegateWarningException(message, innerExceptions);
     case ExceptionSeverity.ModuleWarning:
       return new MagickModuleWarningException(message, innerExceptions);
     case ExceptionSeverity.OptionWarning:
       return new MagickOptionWarningException(message, innerExceptions);
     case ExceptionSeverity.PolicyWarning:
       return new MagickPolicyWarningException(message, innerExceptions);
     case ExceptionSeverity.RegistryWarning:
       return new MagickRegistryWarningException(message, innerExceptions);
     case ExceptionSeverity.ResourceLimitWarning:
       return new MagickResourceLimitWarningException(message, innerExceptions);
     case ExceptionSeverity.StreamWarning:
       return new MagickStreamWarningException(message, innerExceptions);
     case ExceptionSeverity.TypeWarning:
       return new MagickTypeWarningException(message, innerExceptions);
     case ExceptionSeverity.BlobError:
       return new MagickBlobErrorException(message, innerExceptions);
     case ExceptionSeverity.CacheError:
       return new MagickCacheErrorException(message, innerExceptions);
     case ExceptionSeverity.CoderError:
       return new MagickCoderErrorException(message, innerExceptions);
     case ExceptionSeverity.ConfigureError:
       return new MagickConfigureErrorException(message, innerExceptions);
     case ExceptionSeverity.CorruptImageError:
       return new MagickCorruptImageErrorException(message, innerExceptions);
     case ExceptionSeverity.DelegateError:
       return new MagickDelegateErrorException(message, innerExceptions);
     case ExceptionSeverity.DrawError:
       return new MagickDrawErrorException(message, innerExceptions);
     case ExceptionSeverity.FileOpenError:
       return new MagickFileOpenErrorException(message, innerExceptions);
     case ExceptionSeverity.ImageError:
       return new MagickImageErrorException(message, innerExceptions);
     case ExceptionSeverity.MissingDelegateError:
       return new MagickMissingDelegateErrorException(message, innerExceptions);
     case ExceptionSeverity.ModuleError:
       return new MagickModuleErrorException(message, innerExceptions);
     case ExceptionSeverity.OptionError:
       return new MagickOptionErrorException(message, innerExceptions);
     case ExceptionSeverity.PolicyError:
       return new MagickPolicyErrorException(message, innerExceptions);
     case ExceptionSeverity.RegistryError:
       return new MagickRegistryErrorException(message, innerExceptions);
     case ExceptionSeverity.ResourceLimitError:
       return new MagickResourceLimitErrorException(message, innerExceptions);
     case ExceptionSeverity.StreamError:
       return new MagickStreamErrorException(message, innerExceptions);
     case ExceptionSeverity.TypeError:
       return new MagickTypeErrorException(message, innerExceptions);
     default:
       if (severity < ExceptionSeverity.Error)
         return new MagickWarningException(message, innerExceptions);
       else
         return new MagickErrorException(message, innerExceptions);
   }
 }
Ejemplo n.º 48
0
 public EMMADataMissingException(ExceptionSeverity severity, string message, Exception inner, string tableName,
     string key)
     : base(severity, message, inner)
 {
     this.tableName = tableName;
     this.key = key;
 }
Ejemplo n.º 49
0
 public EMMAEveAPIException(ExceptionSeverity severity)
     : base(severity, "Error in EMMA's Eve API communication sub-system")
 {
 }
Ejemplo n.º 50
0
        /// <summary>
        /// Submit an exception to exceptron Servers.
        /// </summary>
        /// <param name="exception">Exception that is being reported</param>
        /// <param name="component"
        /// example="DataAccess, Configuration, Registration, etc."
        /// remarks="It is common to use the logger name that was used to log the exception as the component.">Component that experienced this exception.</param>

        /// <param name="severity">Severity of the exception being reported</param>
        /// <param name="message"
        /// example="Something went wrong while checking for application updates.">Any message that should be attached to this exceptions</param>
        /// <param name="userId"
        /// remarks="This Id does not have to be tied to the user's identity.
        /// You can use a system generated unique ID such as GUID.
        /// This field is used to report how many unique users are experiencing an error."
        /// example="
        /// 62E5C8EF-0CA2-43AB-B278-FC6994F776ED
        /// [email protected]
        /// 26437
        /// ">ID that will uniquely identify the user</param>
        /// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
        /// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
        /// <returns></returns>
        public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null, HttpContext httpContext = null)
        {
            var exceptionData = new ExceptionData
            {
                Exception   = exception,
                Component   = component,
                Severity    = severity,
                Message     = message,
                UserId      = userId,
                HttpContext = httpContext
            };

            return(SubmitException(exceptionData));
        }
Ejemplo n.º 51
0
 public EMMAEveAPIException(ExceptionSeverity severity, int eveApiErrorCode, string eveApiErrorDesc)
     : base(severity, "Eve API error.\r\nCode: " + eveApiErrorCode + "\r\nDescription: " + eveApiErrorDesc,
     eveApiErrorCode != 101 && eveApiErrorCode != 102 && eveApiErrorCode != 103 && eveApiErrorCode != 117)
 {
     this.eveCode = eveApiErrorCode;
     this.eveDescription = eveApiErrorDesc;
 }
Ejemplo n.º 52
0
 public EMMAException(ExceptionSeverity severity)
     : base("EMMA has encountered an unspecified error.")
 {
     this.severity = severity;
     WriteToLog();
 }
 public SapphireDbException(ExceptionSeverity severity = ExceptionSeverity.Warning)
 {
     Severity = severity;
 }
Ejemplo n.º 54
0
        public LogMessage Log(ExceptionSeverity severity, string message, params string[] values)
        {
            string mess = string.Format(message, values);

            return(ds.SaveLogMessage2Db(severity, mess));
        }
Ejemplo n.º 55
0
 /// <summary>
 /// Model not found exception with a custom message and a custom severity.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="exceptionSeverity"></param>
 public ModelNotFoundException(string message, ExceptionSeverity exceptionSeverity)
     : base(message)
 {
     this.ExceptionSeverity = exceptionSeverity;
 }