Ejemplo n.º 1
0
 /// <summary>
 ///     Запись в лог
 /// </summary>
 /// <param name="logLevel">Уровень</param>
 /// <param name="message">Текст записи</param>
 /// <param name="exception">Исключение</param>
 public LogEntry(ErrorLevel logLevel, string message, Exception exception)
     : this()
 {
     Level = logLevel;
     Message = message;
     Exception = exception;
 }
 public static void Output(string Message, ErrorLevel Level)
 {
     if (Level >= ErrorLevel.Error)
         ErrorStream.WriteLine("{0}: {1}", Level.ToString(), Message);
     else
         Console.WriteLine("{0}: {1}", Level.ToString(), Message);
 }
Ejemplo n.º 3
0
		/// <summary>
		/// Creates a new reader
		/// </summary>
		/// <param name="stream"></param>
		/// <param name="errorLevel"></param>
		public FbxAsciiReader(Stream stream, ErrorLevel errorLevel = ErrorLevel.Checked)
		{
			if(stream == null)
				throw new ArgumentNullException(nameof(stream));
			this.stream = stream;
			this.errorLevel = errorLevel;
		}
Ejemplo n.º 4
0
        public void Log(object message, ErrorLevel level, SocketKey key = null)
        {
            lock (_logLock)
            {
                entries.Add(new LogEntry()
                {
                    timestamp = DateTime.Now,
                    level = level,
                    key = key,
                    message = MsgFmt(message)
                });
            }

            switch (level)
            {
                case ErrorLevel.Info:
                    Debug.Log(KeyFmt(key) + message);
                    break;
                case ErrorLevel.Warning:
                    Debug.LogWarning(KeyFmt(key) + message);
                    break;
                case ErrorLevel.Error:
                    Debug.LogError(KeyFmt(key) + message);
                    break;
            }
        }
 public DataReturnUploadError(ErrorLevel errorLevel, UploadErrorType errorType, string description, int lineNumber = 0)
 {
     ErrorType = errorType;
     ErrorLevel = errorLevel;
     Description = description;
     LineNumber = lineNumber;
 }
Ejemplo n.º 6
0
		public void Handle(Exception exception, ErrorLevel errorLevel) {
			if (exception is WrappedException)
				_reportAnyManagedExceptions(exception.Message, ((WrappedException) exception).Exception, errorLevel);
			else
				_reportAnyManagedExceptions(exception.Message, exception, errorLevel);

			if (errorLevel < SdeAppConfiguration.WarningLevel) return;

			if (_exceptionAlreadyShown(exception.Message)) return;

			if (Application.Current != null) {
				_checkMainWindow();

				if (IgnoreNoMainWindow) {
					WindowProvider.ShowWindow(new ErrorDialog("Information", _getHeader(errorLevel) + exception.Message, errorLevel), WpfUtilities.TopWindow);
				}
				else {
					if (!Application.Current.Dispatch(() => Application.Current.MainWindow != null && Application.Current.MainWindow.IsLoaded)) {
						_showBasicError(_getHeader(errorLevel) + exception.Message, "Information");
						return;
					}

					Application.Current.Dispatch(() => WindowProvider.ShowWindow(new ErrorDialog("Information", _getHeader(errorLevel) + exception.Message, errorLevel), Application.Current.MainWindow));
				}
			}
		}
Ejemplo n.º 7
0
 public LogEntry(DateTime errorDateTime, ErrorLevel errorLevel, string tag,string message)
 {
     this.errorDateTime = errorDateTime;
     this.errorLevel = errorLevel;
     this.tag = tag;
     this.message = message;
 }
 public XmlValidationError(ErrorLevel errorLevel, XmlErrorType errorType, string message, int? lineNumber = null)
 {
     ErrorLevel = errorLevel;
     ErrorType = errorType;
     Message = message;
     LineNumber = lineNumber;
 }
Ejemplo n.º 9
0
 internal DaqException(string errorMessage, ErrorCodes errorCode)
     : base(errorMessage)
 {
     m_errorCode = errorCode;
     m_level = ErrorLevel.Error;
     m_lastResponse = null;
 }
Ejemplo n.º 10
0
 public LanguageError(string file, string key, string message, ErrorLevel level = ErrorLevel.MissingString)
 {
     File = file;
     Key = key;
     Message = message;
     Level = level;
 }
Ejemplo n.º 11
0
 public CodeError(ErrorType Type, ErrorLevel Level, CodeLine Line, string Remarks = "")
 {
     this.Type = Type;
     this.Level = Level;
     this.Line = Line;
     this.Remarks = Remarks;
 }
Ejemplo n.º 12
0
 public static void Error(this IEventRegistry registry, IEventSource source, int errorClass, int errorCode, ErrorLevel level, string message, string stackTrace, string errorSource)
 {
     var errorEvent = new ErrorEvent(source, errorClass, errorCode, message);
     errorEvent.ErrorLevel(level);
     errorEvent.StackTrace(stackTrace);
     errorEvent.ErrorSource(errorSource);
     registry.RegisterEvent(errorEvent);
 }
Ejemplo n.º 13
0
 public static void LogException(object ex, ErrorLevel level)
 {
     var e = ex as Exception;
     if (e != null)
     {
         Log(String.Format("{0} - {1}\r\n{2}", level, e.Message, e.StackTrace));
     }
 }
Ejemplo n.º 14
0
 // This is the only thing that needs to be overriden
 public virtual bool Message(MessageSource source, ErrorLevel level, IToken tok, string msg) {
   bool discard = (ErrorsOnly && level != ErrorLevel.Error) || // Discard non-errors if ErrorsOnly is set
                  (tok is TokenWrapper && !(tok is NestedToken) && !(tok is RefinementToken)); // Discard wrapped tokens, except for nested and refinement
   if (!discard) {
     AllMessages[level].Add(new ErrorMessage { token = tok, message = msg });
   }
   return !discard;
 }
Ejemplo n.º 15
0
        public Error(IErrorSource source, string message, ErrorLevel errorLevel)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));

            _source = source;
            _message = message;
            _errorLevel = errorLevel;
        }
Ejemplo n.º 16
0
 public CompilerException(string fileName, int lineNumber, ErrorLevel level, int errorCode, string message)
 {
     _fileName = fileName;
     _lineNumber = lineNumber;
     _level = level;
     _errorCode = errorCode;
     _message = message;
 }
Ejemplo n.º 17
0
 public LogEntry(string processedString)
 {
     string[] parts = processedString.Split(new string[] { " :: " },StringSplitOptions.None);
     this.errorDateTime = DateTime.Parse(parts[0]);
     this.errorLevel = (ErrorLevel)Enum.Parse(typeof(ErrorLevel), parts[1]);
     this.tag = parts[2];
     this.message = parts[3];
 }
Ejemplo n.º 18
0
        public static void Log(string message, ErrorLevel x, params string[] args)
        {
            string msg = Build (string.Format (message, args), x);
            Console.WriteLine (msg);

            if (autoFlush)
                Flush ();
        }
Ejemplo n.º 19
0
        public ErrorEvent(Exception error, int errorCode, ErrorLevel level)
        {
            if (error == null)
                throw new ArgumentNullException("error");

            Error = error;
            ErrorCode = errorCode;
            Level = level;
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Adds an error message to the Error List.
 /// </summary>
 /// <param name="_level">Error level.</param>
 /// <param name="_errorCode">Error code.</param>
 /// <param name="_errorText">Error message text.</param>
 /// <param name="_lineNum">The source code line that raises the error message.</param>
 public static void Add(ErrorLevel _level, string _errorCode, string _errorText, int _lineNum)
 {
     OutputErrorMessage.Instance.Code = _errorCode;
     OutputErrorMessage.Instance.Level = _level;
     OutputErrorMessage.Instance.LineNum = _lineNum;
     OutputErrorMessage.Instance.Text = _errorText;
     Api.SendMessage(Session.CurrentSession.MDIParent.Handle.ToInt32(),
         Convert.ToInt32(MessageHelper.Messages.AddErrorMessage), 0, 0);
 }
Ejemplo n.º 21
0
  		public CompilerError ()
    		{
			ErrorLevel = ErrorLevel.None;
			ErrorMessage = String.Empty;
			SourceFile = String.Empty;
			ErrorNumber = 0;
			SourceColumn = 0;
			SourceLine = 0;
    		}
Ejemplo n.º 22
0
		/// <summary>
		/// Creates a new reader
		/// </summary>
		/// <param name="stream">The stream to read from</param>
		/// <param name="errorLevel">When to throw an <see cref="FbxException"/></param>
		/// <exception cref="ArgumentException"><paramref name="stream"/> does
		/// not support seeking</exception>
		public FbxBinaryReader(Stream stream, ErrorLevel errorLevel = ErrorLevel.Checked)
		{
			if(stream == null)
				throw new ArgumentNullException(nameof(stream));
			if(!stream.CanSeek)
				throw new ArgumentException(
					"The stream must support seeking. Try reading the data into a buffer first");
			this.stream = new BinaryReader(stream, Encoding.ASCII);
			this.errorLevel = errorLevel;
		}
Ejemplo n.º 23
0
        public static void Log(string message, ErrorLevel x = ErrorLevel.Info)
        {
            string msg = Build (message, x);

            messages.Enqueue (msg);
            Console.WriteLine (msg);

            if (autoFlush)
                Flush ();
        }
Ejemplo n.º 24
0
		public static void Handle(string exception, string id, ErrorLevel errorLevel = ErrorLevel.Warning) {
			DebugStreamReader reader = TextFileHelper.LastReader;

			if (reader != null) {
				Handle(String.Format("ID: {0}, file: '{1}', line: {2}, exception: '{3}'", id, TextFileHelper.LatestFile, reader.LineNumber, exception), errorLevel);
			}
			else {
				Handle(String.Format("ID: {0}, exception: '{1}'", id, exception), errorLevel);
			}
		}
Ejemplo n.º 25
0
 public void LogError(string error, ErrorLevel errorLevel)
 {
     if ((int)errorLevel >= _minErrorLevelLogged)
     {
         using (var sw = new StreamWriter(_logFilePath, true))
         {
             sw.WriteLine(string.Format("{0} : {1}", errorLevel, error));
         }
     }
 }
Ejemplo n.º 26
0
 private void defaultErrorDelegate(ErrorKind error, ErrorLevel level, string errormessage)
 {
     if (level == ErrorLevel.K_LWARN) {
         // TODO: use a user supplied callback here or provide some other mechanism to override this
         // NOTE: if using a callback here, the user _must not_ throw exceptions in that callback
         /* Console.WriteLine("nlibk warning: {0}", errormessage); */
         return;
     }
     LastError = error;
     LastErrorMessage = errormessage;
 }
Ejemplo n.º 27
0
		public async static void Log(ErrorLevel level, Exception e = null, string message = null)
		{
			ErrorLog log;
			if (e != null)
				log = new ErrorLog(e, message);
			else if (message != null)
				log = new ErrorLog(message);
			else
				throw new ArgumentException("Both parameters cannot be null!", "e");

			await ExternalApi.Post<bool>(ConfigUtilities.GetString("ErrorLogUrl"), log);
		}
Ejemplo n.º 28
0
 public BlockStatus(string message, ErrorLevel level)
 {
     this.Explanation = message;
     this.ErrorLevel = level;
     switch(level)
     {
         case Publishing.ErrorLevel.ManualCorrection: Brush = Brushes.Red; break;
         case Publishing.ErrorLevel.AutoCorrection: Brush = Brushes.Yellow; break;
         case Publishing.ErrorLevel.Warning: Brush = Brushes.Cyan; break;
         case Publishing.ErrorLevel.No: Brush = Brushes.Green; break;
     }
 }
Ejemplo n.º 29
0
 private static void WriteInLogFile(FileMode fileMode, string filePath, ErrorLevel errorLevel, string message, Exception ex)
 {
     using (var stream = new FileStream(filePath, fileMode))
     using (var stringWriter = new StreamWriter(stream))
     {
         stringWriter.WriteLine("====================Begin Error====================");
         stringWriter.WriteLine("Error level: " + errorLevel.ToString());
         stringWriter.WriteLine("Message from app: " + message);
         stringWriter.WriteLine("Exception: " + ex.ToString());
         stringWriter.WriteLine("Time: " + DateTime.UtcNow);
         stringWriter.WriteLine("====================End Error====================");
     }
 }
Ejemplo n.º 30
0
 private ConsoleColor ColorForLevel(ErrorLevel level)
 {
     switch (level) {
     case ErrorLevel.Error:
       return ConsoleColor.Red;
     case ErrorLevel.Warning:
       return ConsoleColor.Yellow;
     case ErrorLevel.Info:
       return ConsoleColor.Green;
     default:
       throw new cce.UnreachableException();
       }
 }
Ejemplo n.º 31
0
 public ParserInitializationError(ErrorLevel level, string message) : base(level, message)
 {
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Записать в лог
 /// </summary>
 /// <param name="level">Уровень</param>
 /// <param name="message">Текст</param>
 public void Log(ErrorLevel level, string message)
 {
     Log(new LogEntry {
         Level = level, Message = message
     });
 }
Ejemplo n.º 33
0
 public static void Log(ErrorLevel level, string message)
 {
     errorList.Add(new Error(level, message));
 }
Ejemplo n.º 34
0
        // Return value indicates download success
        static async Task <bool> TryDownloadFile(Func <Task <Stream> > func, string outputFile, ErrorLevel level = ErrorLevel.Info)
        {
            try {
                using (var astrm = await func.Invoke())
                    using (var sw = File.Create(outputFile))
                        await astrm.CopyToAsync(sw);

                return(true);
            } catch (Exception ex) {
                if (level == ErrorLevel.Error)
                {
                    throw;
                }

                if (level == ErrorLevel.Info)
                {
                    Trace.WriteLine($"Failed to download {Path.GetFileName (outputFile)}: {ex.Message}");
                }

                return(false);
            }
        }
Ejemplo n.º 35
0
 internal void Error(ErrorCode code, ErrorLevel level = ErrorLevel.Error)
 {
     Errors.Add(new Error(level, code, Lexer.LastTokenLine));
     CheckTooManyErrors();
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageEventArgs"/> class.
 /// </summary>
 /// <param name="text">The text for the message.</param>
 /// <param name="caption">The title (caption) for the message.</param>
 /// <param name="errorlevel">The error level for the message, or None for no error level information.</param>
 public MessageEventArgs(string text, string caption, ErrorLevel errorlevel)
 {
     this.Text       = text;
     this.Caption    = caption;
     this.ErrorLevel = errorlevel;
 }
 public ValidationRuleEntierRequis(string name, IValidationRule nextValidationRule, string messageValidationRule, ErrorLevel errorLevelValidationRule, ValidationDataEntier validationDataEntier)
     : base(name, nextValidationRule, messageValidationRule, errorLevelValidationRule)
 {
     ValidationDataEntier = validationDataEntier;
     ValidationDataEntier.Rules.Add(Name);
 }
Ejemplo n.º 38
0
 public Error(DateTime dateTime, ErrorLevel level, string message)
 {
     this.DateTime   = dateTime;
     this.ErrorLevel = level;
     this.Message    = message;
 }
Ejemplo n.º 39
0
        public static void Handle(Exception err, string exception, string id, int line, ErrorLevel errorLevel)
        {
            if (line < 0)
            {
                Handle(err, exception, id, errorLevel);
                return;
            }

            Handle(err, String.Format("ID: {0}, file: '{1}', line: {2}, exception: '{3}'", id, TextFileHelper.LatestFile, line, exception), errorLevel);
        }
Ejemplo n.º 40
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="DataErrorInfo" /> class.
 /// </summary>
 /// <param name="message">
 ///     The message.
 /// </param>
 /// <param name="errorLevel">
 ///     The error level.
 /// </param>
 public DataErrorInfo(string message, ErrorLevel errorLevel)
     :
     this(message, errorLevel, null)
 {
 }
Ejemplo n.º 41
0
 public static void AddMsg(ValidateContext validateContext, ExtendedDataEntity entity, string title, string msg, string displayToFieldKey = "", ErrorLevel errorLevel = 2)
 {
     if (displayToFieldKey.IsNullOrEmptyOrWhiteSpace())
     {
         displayToFieldKey = validateContext.BusinessInfo.GetBillNoField().Key;
     }
     AddMsg(validateContext, entity, displayToFieldKey, entity["Id"].ToString(), title, msg, errorLevel);
 }
Ejemplo n.º 42
0
 internal void Error(ErrorCode code, Token token, string description, ErrorLevel level = ErrorLevel.Error)
 {
     Errors.Add(new Error(level, code, description, Lexer.LastTokenLine));
     CheckTooManyErrors();
 }
Ejemplo n.º 43
0
 internal void Error(ErrorCode code, Token token, ErrorLevel level = ErrorLevel.Error)
 {
     Errors.Add(new Error(level, code, token.Value.MakeQuoted(), Lexer.LastTokenLine));
     CheckTooManyErrors();
 }
Ejemplo n.º 44
0
        public void ShowError(string obj, EventHandler okClick = null, bool bCreateButtonEvent = false, int iAddCounterSeconds = 0, ErrorLevel errorLevel = ErrorLevel.Normal)
        {
            var errorSettings = new ErrorSettings();

            errorSettings.ErrorLevel        = errorLevel;
            errorSettings.OkClick           = okClick;
            errorSettings.CreateButtonEvent = bCreateButtonEvent;
            errorSettings.AddCounterSeconds = iAddCounterSeconds;
            if (errorSettings.ErrorLevel == ErrorLevel.Normal)
            {
                errorSettings.WarningVisibility = Visibility.Collapsed;
            }
            if (errorSettings.ErrorLevel == ErrorLevel.ModalWindow)
            {
                errorSettings.ErrorLevel  = ErrorLevel.Critical;
                errorSettings.HideButtons = true;
            }

            ShowError(obj, errorSettings);
        }
Ejemplo n.º 45
0
 public Error(ErrorLevel errorLevel, DateTime dateTime, string message)
 {
     this.ErrorLevel = errorLevel;
     this.DateTime   = dateTime;
     this.Message    = message;
 }
        /// <summary>
        /// Gets all the mods and patches them.
        /// </summary>
        private void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            _errorLevel = ErrorLevel.NoError;

            //Gets the list of mods
            ItemCollection modCollection = null;
            string         lolLocation   = null;

            //Get the data from the UI thread
            Dispatcher.Invoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                modCollection = ModsListBox.Items;
                lolLocation   = LocationTextbox.Text;
            }));

            SetStatusLabelAsync("Gathering mods...");

            //Gets the list of mods that have been checked.
            List <LessMod> modsToPatch = new List <LessMod>();

            foreach (var x in modCollection)
            {
                CheckBox box          = (CheckBox)x;
                bool     isBoxChecked = false;
                Dispatcher.Invoke(DispatcherPriority.Input, new ThreadStart(() =>
                {
                    isBoxChecked = box.IsChecked ?? false;
                }));

                if (isBoxChecked)
                {
                    modsToPatch.Add(_lessMods[box]);
                }
            }

            //Create a new dictionary to hold the SWF definitions in. This stops opening and closing the same SWF file if it's going to be modified more than once.
            Dictionary <string, SwfFile> swfs = new Dictionary <string, SwfFile>();

            //Start the stopwatch to see how long it took to patch (aiming for ~5 sec or less on test machine)
            timer = Stopwatch.StartNew();

            //Go through each modification
            foreach (var lessMod in modsToPatch)
            {
                SetStatusLabelAsync("Patching mod: " + lessMod.Name);

                //Go through each patch within the mod
                foreach (var patch in lessMod.Patches)
                {
                    //If the swf hasn't been loaded, load it into the dictionary.
                    if (!swfs.ContainsKey(patch.Swf))
                    {
                        string fullPath = Path.Combine(lolLocation, patch.Swf);

                        //Backup the SWF
                        string   CurrentLocation = "";
                        string[] FileLocation    = patch.Swf.Split('/', '\\');
                        foreach (string s in FileLocation.Take(FileLocation.Length - 1))
                        {
                            CurrentLocation = Path.Combine(CurrentLocation, s);
                            if (!Directory.Exists(Path.Combine(lolLocation, "LESsBackup", BackupVersion, CurrentLocation)))
                            {
                                Directory.CreateDirectory(Path.Combine(lolLocation, "LESsBackup", BackupVersion, CurrentLocation));
                            }
                        }
                        if (!File.Exists(Path.Combine(lolLocation, "LESsBackup", BackupVersion, patch.Swf)))
                        {
                            File.Copy(Path.Combine(lolLocation, patch.Swf), Path.Combine(lolLocation, "LESsBackup", BackupVersion, patch.Swf));
                        }

                        swfs.Add(patch.Swf, SwfFile.ReadFile(fullPath));
                    }

                    //Get the SWF file that is being modified
                    SwfFile swf = swfs[patch.Swf];

                    //Get the ABC tags (containing the code) from the swf file.
                    List <DoAbcTag> tags       = swf.GetDoAbcTags();
                    bool            classFound = false;
                    foreach (var tag in tags)
                    {
                        //check if this tag contains our script
                        ScriptInfo si = tag.GetScriptByClassName(patch.Class);

                        //check next tag if it doesn't
                        if (si == null)
                        {
                            continue;
                        }

                        ClassInfo cls = si.GetClassByClassName(patch.Class);
                        classFound = true;

                        Assembler asm;
                        //Perform the action based on what the patch defines
                        switch (patch.Action)
                        {
                        case "replace_trait":     //replace trait (method)
                            //Load the code from the patch and assemble it to be inserted into the code
                            asm = new Assembler(File.ReadAllText(Path.Combine(lessMod.Directory, patch.Code)));
                            TraitInfo newTrait = asm.Assemble() as TraitInfo;

                            int  traitIndex = cls.Instance.GetTraitIndexByTypeAndName(newTrait.Type, newTrait.Name.Name);
                            bool classTrait = false;
                            if (traitIndex < 0)
                            {
                                traitIndex = cls.GetTraitIndexByTypeAndName(newTrait.Type, newTrait.Name.Name);
                                classTrait = true;
                            }
                            if (traitIndex < 0)
                            {
                                throw new TraitNotFoundException(String.Format("Can't find trait \"{0}\" in class \"{1}\"", newTrait.Name.Name, patch.Class));
                            }

                            //Modified the found trait
                            if (classTrait)
                            {
                                cls.Traits[traitIndex] = newTrait;
                            }
                            else
                            {
                                cls.Instance.Traits[traitIndex] = newTrait;
                            }
                            break;

                        case "replace_cinit":    //replace class constructor
                            //Load the code from the patch and assemble it to be inserted into the code
                            asm           = new Assembler(File.ReadAllText(Path.Combine(lessMod.Directory, patch.Code)));
                            cls.ClassInit = asm.Assemble() as MethodInfo;
                            break;

                        case "replace_iinit":    //replace instance constructor
                            //Load the code from the patch and assemble it to be inserted into the code
                            asm = new Assembler(File.ReadAllText(Path.Combine(lessMod.Directory, patch.Code)));
                            cls.Instance.InstanceInit = asm.Assemble() as MethodInfo;
                            break;

                        case "add_class_trait":     //add new class trait (method)
                            //Load the code from the patch and assemble it to be inserted into the code
                            asm        = new Assembler(File.ReadAllText(Path.Combine(lessMod.Directory, patch.Code)));
                            newTrait   = asm.Assemble() as TraitInfo;
                            traitIndex = cls.GetTraitIndexByTypeAndName(newTrait.Type, newTrait.Name.Name);
                            if (traitIndex < 0)
                            {
                                cls.Traits.Add(newTrait);
                            }
                            else
                            {
                                cls.Traits[traitIndex] = newTrait;
                            }
                            break;

                        case "add_instance_trait":     //add new instance trait (method)
                            //Load the code from the patch and assemble it to be inserted into the code
                            asm        = new Assembler(File.ReadAllText(Path.Combine(lessMod.Directory, patch.Code)));
                            newTrait   = asm.Assemble() as TraitInfo;
                            traitIndex = cls.Instance.GetTraitIndexByTypeAndName(newTrait.Type, newTrait.Name.Name);
                            if (traitIndex < 0)
                            {
                                cls.Instance.Traits.Add(newTrait);
                            }
                            else
                            {
                                cls.Instance.Traits[traitIndex] = newTrait;
                            }
                            break;

                        case "remove_class_trait":
                            throw new NotImplementedException();

                        case "remove_instance_trait":
                            throw new NotImplementedException();

                        default:
                            throw new NotSupportedException($"Unknown Action \"{patch.Action}\" in mod {lessMod.Name}");
                        }
                    }

                    if (!classFound)
                    {
                        _errorLevel = ErrorLevel.UnableToPatch;
                        throw new ClassNotFoundException($"Class {patch.Class} not found in file {patch.Swf}");
                    }
                }
            }

            //Save the modified SWFS to their original location
            foreach (var patchedSwf in swfs)
            {
                try
                {
                    SetStatusLabelAsync("Applying mods: " + patchedSwf.Key);
                    string swfLoc = Path.Combine(lolLocation, patchedSwf.Key);
                    SwfFile.WriteFile(patchedSwf.Value, swfLoc);
                }
                catch
                {
                    _errorLevel = ErrorLevel.GoodJobYourInstallationIsProbablyCorruptedNow;
                    if (Debugger.IsAttached)
                    {
                        throw;
                    }
                }
            }
            timer.Stop();
        }
Ejemplo n.º 47
0
 public ConsoleAppender(ILayout layout, ErrorLevel errorLevel)
 {
     this.Layout           = layout;
     this.ErrorLevel       = errorLevel;
     this.MessagesAppended = 0;
 }
Ejemplo n.º 48
0
 /// <summary>
 /// Записать в лог с приложением исключения
 /// </summary>
 /// <param name="level">Уровень записи</param>
 /// <param name="message">Текст</param>
 /// <param name="exception">Исключение</param>
 public void Exception(ErrorLevel level, string message, Exception exception)
 {
     Log(new LogEntry {
         Level = level, Message = message, Exception = exception
     });
 }
Ejemplo n.º 49
0
 public JsonPacket Create(string project, Exception exception, SentryMessage message = null, ErrorLevel level = ErrorLevel.Error,
                          IDictionary <string, string> tags = null, string[] fingerprint = null, object extra = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 50
0
#pragma warning disable 612
        public void SetWorkflowTerminated(ProcessInstance processInstance, ErrorLevel level, string errorMessage)
#pragma warning restore 612
        {
            SetCustomStatus(processInstance.ProcessId, ProcessStatus.Terminated);
        }
Ejemplo n.º 51
0
 internal Error(ErrorLevel level, string message)
 {
     this.level   = level;
     this.message = message;
 }
 private static void AssertThatFieldHasError(DocField field, ErrorLevel expectedErrorLevel, string expectedErrorText)
 {
     Assert.That(field.ErrorLevel, Is.EqualTo(expectedErrorLevel));
     Assert.That(field.ErrorText, Is.EqualTo(expectedErrorText));
 }
 private static void AssertThatTrustDateHasSpecificErrorLevel(TrustDate trustDate, ErrorLevel expectedErrorLevel, string expectedErrorText)
 {
     AssertThatFieldHasError(trustDate.Day, expectedErrorLevel, expectedErrorText);
     AssertThatFieldHasError(trustDate.Month, expectedErrorLevel, expectedErrorText);
     AssertThatFieldHasError(trustDate.Year, expectedErrorLevel, expectedErrorText);
 }
        public ErrorForm(ErrorFormTemplate errorFormTemplate)
        {
            if (null == errorFormTemplate)
            {
                throw new ArgumentNullException(nameof(errorFormTemplate));
            }

            if (ApplicationUtility.IsRunningOnMono)
            {
                Font = new Font("Arial", 8);
            }

            InitializeComponent();

            _originalCaption = errorFormTemplate.OriginalCaption ??
                               throw new BadTemplateException("null == errorFormTemplate.Caption");
            Text = errorFormTemplate.Caption;
            captionLabel.Text       = errorFormTemplate.Caption;
            messageRichTextBox.Text = errorFormTemplate.Message ??
                                      throw new BadTemplateException("null == errorFormTemplate.Message");

            if (null != errorFormTemplate.Details)
            {
                detailsRichTextBox.Text = errorFormTemplate.Details;
            }

            _errorLevel = errorFormTemplate.Level;

            ((ISupportInitialize)iconPictureBox).BeginInit();
            switch (errorFormTemplate.Level)
            {
            case ErrorLevel.Error:
                iconPictureBox.Image = iconImageList.Images[0];
                break;

            case ErrorLevel.Warning:
                iconPictureBox.Image = iconImageList.Images[1];
                break;
            }
            ((ISupportInitialize)iconPictureBox).EndInit();

            _heightDifference = detailsRichTextBox.Height +
                                detailsRichTextBox.Margin.Top +
                                detailsRichTextBox.Margin.Bottom +
                                separatorLabel.Height +
                                separatorLabel.Margin.Top +
                                separatorLabel.Margin.Bottom +
                                reportButton.Height +
                                reportButton.Margin.Top +
                                reportButton.Margin.Bottom;

            HideDetails();
            _detailsVisible = false;

            if (null == errorFormTemplate.Details)
            {
                detailsButton.Enabled = false;
            }

            reportButton.Enabled = null != SupportAction;
        }
Ejemplo n.º 55
0
 public ConsoleAppender(ILayout layout, ErrorLevel level)
 {
     this.Layout           = layout;
     this.Level            = level;
     this.MessagesAppendet = 0;
 }
Ejemplo n.º 56
0
Archivo: Dare.cs Proyecto: ggrov/tacny
 public override bool Message(MessageSource source, ErrorLevel level, Bpl.IToken tok, string msg)
 {
     return(false);
 }
Ejemplo n.º 57
0
        /// <summary>
        /// Overrides the default error level.
        /// <para>The default error level is "error".</para>
        /// </summary>
        /// <param name="level">
        ///     The error level to use for the captured event
        /// </param>
        public SentryEventBuilder SetErrorLevel(ErrorLevel level)
        {
            _errorLevel = level;

            return(this);
        }
Ejemplo n.º 58
0
 public Diagnostic(string message, TextLocation location, ErrorLevel level)
 {
     Message  = message;
     Location = location;
     Level    = level;
 }
Ejemplo n.º 59
0
 public static void Handle(Exception err, string exception, string id, int line, string file, ErrorLevel level)
 {
     Handle(err, String.Format("ID: {0}, file: '{1}', line: {2}, exception: '{3}'", id, file, line, exception), level);
 }
Ejemplo n.º 60
0
        public static void AddMsg(ValidateContext validateContext, ExtendedDataEntity entity, string displayToFieldKey, string id, string title, string msg, ErrorLevel errorLevel = 2)
        {
            ValidationErrorInfo errorInfo = new ValidationErrorInfo(displayToFieldKey, entity.DataEntity["Id"].ToString(), entity.DataEntityIndex, entity.RowIndex, id, msg, title, errorLevel);

            validateContext.AddError(entity.DataEntity, errorInfo);
        }