public SimpleError GenerateSimpleError(int maxErrorNestingLevel = 3, bool generateData = true, int currentNestingLevel = 0)
        {
            var error = new SimpleError {
                Message = @"Generated exception message.", Type = ExceptionTypes.Random()
            };

            if (generateData)
            {
                for (int i = 0; i < RandomData.GetInt(1, 5); i++)
                {
                    string key = RandomData.GetWord();
                    while (error.Data.ContainsKey(key) || key == Event.KnownDataKeys.Error)
                    {
                        key = RandomData.GetWord();
                    }

                    error.Data.Add(key, RandomData.GetString());
                }
            }

            error.StackTrace = RandomData.GetString();

            if (currentNestingLevel < maxErrorNestingLevel && RandomData.GetBool())
            {
                error.Inner = GenerateSimpleError(maxErrorNestingLevel, generateData, currentNestingLevel + 1);
            }

            return(error);
        }
        public Error GenerateError(int maxErrorNestingLevel = 3, bool generateData = true, int currentNestingLevel = 0)
        {
            var error = new Error {
                Message = @"Generated exception message.", Type = ExceptionTypes.Random()
            };

            if (RandomData.GetBool())
            {
                error.Code = RandomData.GetInt(-234523453, 98690899).ToString();
            }

            if (generateData)
            {
                for (int i = 0; i < RandomData.GetInt(1, 5); i++)
                {
                    string key = RandomData.GetWord();
                    while (error.Data.ContainsKey(key) || key == Event.KnownDataKeys.Error)
                    {
                        key = RandomData.GetWord();
                    }

                    error.Data.Add(key, RandomData.GetString());
                }
            }

            var stack = new StackFrameCollection();

            for (int i = 0; i < RandomData.GetInt(1, 10); i++)
            {
                stack.Add(GenerateStackFrame());
            }
            error.StackTrace = stack;

            if (currentNestingLevel < maxErrorNestingLevel && RandomData.GetBool())
            {
                error.Inner = GenerateError(maxErrorNestingLevel, generateData, currentNestingLevel + 1);
            }

            return(error);
        }