<commit_before>﻿using System;
using System.Linq;
using System.Web.Mvc;
using PaylevenWebAppSharp;

namespace PaylevenWebAppSharpDemo.Controllers
{
    public class ResponseController : BaseController
    {
        public ActionResult Index()
        {
            var response = PaylevenWebApp.ValidateResponse(Request);

            var type = typeof(PaylevenResponse);

            var properties = type
                .GetProperties()
                .ToDictionary(property => property.Name, property => property.GetValue(response));

            return View(properties);
        }
    }
}<commit_msg>show response validation exceptions<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using PaylevenWebAppSharp;

namespace PaylevenWebAppSharpDemo.Controllers
{
    public class ResponseController : BaseController
    {
        public ActionResult Index()
        {
            try
            {
                var response = PaylevenWebApp.ValidateResponse(Request);

                var type = typeof(PaylevenResponse);

                var properties = type
                    .GetProperties()
                    .ToDictionary(property => property.Name, property => property.GetValue(response));

                return View(properties);
            }
            catch (Exception ex)
            {
                return View(new Dictionary<string, object>
                {
                    {"Exception", ex.Message}
                });
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.0799739921976593, 'fraction_numerical': 0.0, 'mean_word_length': 1.8766355140186917, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, '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': '3107681', 'n_tokens_mistral': 381, 'n_tokens_neox': 363, 'n_words': 81}