<commit_before>using System;

namespace IniParser.Exceptions
{
    /// <summary>
    /// Represents an error ococcurred while parsing data 
    /// </summary>
    public class ParsingException : Exception
    {
        public int LineNumber {get; private set;}
        public string LineValue {get; private set;}

        public ParsingException(string msg)
            :this(msg, 0, string.Empty, null) 
        {}

        public ParsingException(string msg, Exception innerException)
            :this(msg, 0, string.Empty, innerException) 
        {}

        public ParsingException(string msg, int lineNumber, string lineValue)
            :this(msg, lineNumber, lineValue, null)
        {}
            
        public ParsingException(string msg, int lineNumber, string lineValue, Exception innerException)
            : base(string.Format("Error \'{2}\' while parsing line {1}: \'{0}\'", lineValue, lineNumber, msg), innerException) 
        { 
            LineNumber = lineNumber;
            LineValue = lineValue;
        }
    }
}<commit_msg>Get the library version when a ParsingException happens<commit_after>using System;

namespace IniParser.Exceptions
{
    /// <summary>
    /// Represents an error ococcurred while parsing data 
    /// </summary>
    public class ParsingException : Exception
    {
        public Version LibVersion {get; private set;}
        public int LineNumber {get; private set;}
        public string LineValue {get; private set;}

        public ParsingException(string msg)
            :this(msg, 0, string.Empty, null) 
        {}

        public ParsingException(string msg, Exception innerException)
            :this(msg, 0, string.Empty, innerException) 
        {}

        public ParsingException(string msg, int lineNumber, string lineValue)
            :this(msg, lineNumber, lineValue, null)
        {}
            
        public ParsingException(string msg, int lineNumber, string lineValue, Exception innerException)
            : base(
                string.Format(
                    "{0} while parsing line number {1} with value \'{2}\' - IniParser version: {3}", 
                    msg, lineNumber, lineValue, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version),
                innerException) 
        { 
            LibVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            LineNumber = lineNumber;
            LineValue = lineValue;
        }
    }
}
{'fraction_non_alphanumeric': 0.09458367016976556, 'fraction_numerical': 0.00444624090541633, 'mean_word_length': 2.231070496083551, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7143273', 'n_tokens_mistral': 646, 'n_tokens_neox': 612, 'n_words': 183}