<commit_before>(function () {
    "use strict";

    var app = angular.module('aiohttp_admin', ['ng-admin']);

    app.config(['NgAdminConfigurationProvider', function (NgAdminConfigurationProvider) {
        var nga = NgAdminConfigurationProvider;

        var admin = nga.application('aiohttp admin demo')
            .debug(true)
            .baseApiUrl('/admin/');

        var question = nga.entity('question');
        var choice = nga.entity('choice');
<commit_msg>better error messages<commit_after>(function () {
    "use strict";

    var app = angular.module('aiohttp_admin', ['ng-admin']);

    app.config(['NgAdminConfigurationProvider', function (NgAdminConfigurationProvider) {
        var nga = NgAdminConfigurationProvider;

        var admin = nga.application('aiohttp admin demo')
            .debug(true)
            .baseApiUrl('/admin/');

        admin.errorMessage(function (response) {
            var msg = '<p>Oops error occured with status code: ' + response.status + '</p>\n';

            if ('error_details' in response.data ){
                msg += '<code>';
                msg += JSON.stringify(response.data.error_details, null, 2);
                msg += '</code>';
            }
            return msg;
        });

        var question = nga.entity('question');
        var choice = nga.entity('choice');

{'fraction_non_alphanumeric': 0.13913690476190477, 'fraction_numerical': 0.000744047619047619, 'mean_word_length': 2.4050632911392404, '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': '5978256', 'n_tokens_mistral': 370, 'n_tokens_neox': 354, 'n_words': 80}