<commit_before>angular.module('orderCloud')
    .config(function($qProvider, $provide) {
        //Error Handling
        $provide.value('ocErrorMessages', {
            customPassword: 'Password must be at least eight characters long and include at least one letter and one number',
            positiveInteger: 'Please enter a positive integer',
            ID_Name: 'Only Alphanumeric characters, hyphens and underscores are allowed',
            confirmpassword: 'Your passwords do not match',
            noSpecialChars: 'Only Alphanumeric characters are allowed',
            'Buyer.UnavailableID': 'This ID is already in use.',
            'LineItem.UnavailableID': 'This ID is already in use.',
            'User.UsernameMustBeUnique': 'This username is already in use.'
        });

        $provide.decorator('$exceptionHandler', handler);
        $qProvider.errorOnUnhandledRejections(false); //Stop .catch validation from angular v1.6.0
        function handler($delegate, $injector) { //Catch all for unhandled errors
            return function(ex, cause) {
                //TODO: this was changed to include the below if statement on 2/7/2017 - this change could cause unknown issues
                if (ex) {
                    $delegate(ex, cause);
                    $injector.get('toastr').error(ex.data ? (ex.data.error || (ex.data.Errors ? ex.data.Errors[0].Message : ex.data)) : ex.message, 'Error');
                }
            };
        }
    })
;

<commit_msg>SDK Update: Error Handling<commit_after>angular.module('orderCloud')
    .config(function($qProvider, $provide) {
        //Error Handling
        $provide.value('ocErrorMessages', {
            customPassword: 'Password must be at least eight characters long and include at least one letter and one number',
            positiveInteger: 'Please enter a positive integer',
            ID_Name: 'Only Alphanumeric characters, hyphens and underscores are allowed',
            confirmpassword: 'Your passwords do not match',
            noSpecialChars: 'Only Alphanumeric characters are allowed',
            'Buyer.UnavailableID': 'This ID is already in use.',
            'LineItem.UnavailableID': 'This ID is already in use.',
            'User.UsernameMustBeUnique': 'This username is already in use.'
        });

        $provide.decorator('$exceptionHandler', handler);
        $qProvider.errorOnUnhandledRejections(false); //Stop .catch validation from angular v1.6.0
        function handler($delegate, $injector) { //Catch all for unhandled errors
            return function(ex, cause) {
                //TODO: this was changed to include the below if statement on 2/7/2017 - this change could cause unknown issues
                if (ex) {
                    $delegate(ex, cause);
                    var message = (ex.response && ex.response.body && ex.response.body.Errors && ex.response.body.Errors.length) ? 
                        ex.response.body.Errors[0].Message : 
                        ex.message;

                    $injector.get('toastr').error(message, 'Error');
                }
            };
        }
    })
;


{'fraction_non_alphanumeric': 0.1039209435766656, 'fraction_numerical': 0.006375518010838381, 'mean_word_length': 2.195519348268839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3951412', 'n_tokens_mistral': 823, 'n_tokens_neox': 786, 'n_words': 248}