<commit_before>import Ember from 'ember';

export default Ember.Mixin.create({
    actions: {
        error(error, transition) {
            if (error.errors[0].errorType === 'NotFoundError') {
                transition.abort();

                let routeInfo = transition.handlerInfos[transition.handlerInfos.length - 1];
                let router = this.get('router');
                let params = [];

                for (const key of Object.keys(routeInfo.params)) {
                    params.push(routeInfo.params[key]);
                }

                return this.transitionTo('error404', router.generate(routeInfo.name, ...params).replace('/ghost/', '').replace(/^\//g, ''));
            }

            return this._super(...arguments);
        }
    }
});<commit_msg>Prevent 404-handler mixin from erroring on non-adapter errors<commit_after>import Ember from 'ember';

export default Ember.Mixin.create({
    actions: {
        error(error, transition) {
            if (error.errors && error.errors[0].errorType === 'NotFoundError') {
                transition.abort();

                let routeInfo = transition.handlerInfos[transition.handlerInfos.length - 1];
                let router = this.get('router');
                let params = [];

                for (const key of Object.keys(routeInfo.params)) {
                    params.push(routeInfo.params[key]);
                }

                return this.transitionTo('error404', router.generate(routeInfo.name, ...params).replace('/ghost/', '').replace(/^\//g, ''));
            }

            return this._super(...arguments);
        }
    }
});
{'fraction_non_alphanumeric': 0.14434889434889434, 'fraction_numerical': 0.007985257985257985, 'mean_word_length': 1.8429319371727748, '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': '1196921', 'n_tokens_mistral': 446, 'n_tokens_neox': 414, 'n_words': 80}