<commit_before>﻿using System;
using Cuemon.AspNetCore.Diagnostics;

namespace Cuemon.AspNetCore.Mvc.Filters.Diagnostics
{
    /// <summary>
    /// Provides a way to evaluate an exception and provide details about it for in a developer friendly way.
    /// </summary>
    public class FaultResolver
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FaultResolver"/> class.
        /// </summary>
        /// <param name="validator">The function delegate that evaluates an <see cref="Exception"/>.</param>
        /// <param name="descriptor">The function delegate that provides details about an <see cref="Exception"/>.</param>
        public FaultResolver(Func<Exception, bool> validator, Func<Exception, HttpExceptionDescriptor> descriptor)
        {
            Cuemon.Validator.ThrowIfNull(validator, nameof(validator));
            Cuemon.Validator.ThrowIfNull(descriptor, nameof(descriptor));
            Validator = validator;
            Descriptor = descriptor;
        }

        internal Func<Exception, HttpExceptionDescriptor> Descriptor { get; private set; }

        internal Func<Exception, bool> Validator { get; set; }
    }
}<commit_msg>Two internal members made public; for extensibility.<commit_after>﻿using System;
using Cuemon.AspNetCore.Diagnostics;

namespace Cuemon.AspNetCore.Mvc.Filters.Diagnostics
{
    /// <summary>
    /// Provides a way to evaluate an exception and provide details about it for in a developer friendly way.
    /// </summary>
    public class FaultResolver
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FaultResolver"/> class.
        /// </summary>
        /// <param name="validator">The function delegate that evaluates an <see cref="Exception"/>.</param>
        /// <param name="descriptor">The function delegate that provides details about an <see cref="Exception"/>.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="validator"/> cannot be null -or-
        /// <paramref name="descriptor"/> cannot be null.
        /// </exception>
        public FaultResolver(Func<Exception, bool> validator, Func<Exception, HttpExceptionDescriptor> descriptor)
        {
            Cuemon.Validator.ThrowIfNull(validator, nameof(validator));
            Cuemon.Validator.ThrowIfNull(descriptor, nameof(descriptor));
            Validator = validator;
            Descriptor = descriptor;
        }

        /// <summary>
        /// Gets the function delegate that provides details about an <see cref="Exception"/>.
        /// </summary>
        /// <value>The function delegate that provides details about an <see cref="Exception"/>.</value>
        public Func<Exception, HttpExceptionDescriptor> Descriptor { get; }

        /// <summary>
        /// Gets the function delegate that evaluates an <see cref="Exception"/>.
        /// </summary>
        /// <value>The function delegate that evaluates an <see cref="Exception"/>.</value>
        public Func<Exception, bool> Validator { get; }
    }
}
{'fraction_non_alphanumeric': 0.12181580666231222, 'fraction_numerical': 0.0, 'mean_word_length': 2.6594982078853047, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '2495530', 'n_tokens_mistral': 745, 'n_tokens_neox': 755, 'n_words': 237}