<commit_before>import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default Route.extend({
  notifications: service(),

  queryParams: {
    page: { refreshModel: true },
    sort: { refreshModel: true },
  },

  async model(params) {
    const { team_id } = params;

    try {
      let team = await this.store.queryRecord('team', { team_id });

      params.team_id = team.get('id');
      params.include_yanked = 'n';
      let crates = await this.store.query('crate', params);

      return { crates, team };
    } catch (e) {
      if (e.errors.some(e => e.detail === 'Not Found')) {
        this.notifications.error(`Team '${params.team_id}' does not exist`);
        return this.replaceWith('index');
      }
    }
  },
});<commit_msg>team: Fix error handling for errors without an `errors` property<commit_after>import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default Route.extend({
  notifications: service(),

  queryParams: {
    page: { refreshModel: true },
    sort: { refreshModel: true },
  },

  async model(params) {
    const { team_id } = params;

    try {
      let team = await this.store.queryRecord('team', { team_id });

      params.team_id = team.get('id');
      params.include_yanked = 'n';
      let crates = await this.store.query('crate', params);

      return { crates, team };
    } catch (e) {
      if (e.errors?.some(e => e.detail === 'Not Found')) {
        this.notifications.error(`Team '${params.team_id}' does not exist`);
        return this.replaceWith('index');
      }

      throw e;
    }
  },
});
{'fraction_non_alphanumeric': 0.15696969696969698, 'fraction_numerical': 0.0, 'mean_word_length': 2.8665105386416863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2711721', 'n_tokens_mistral': 513, 'n_tokens_neox': 507, 'n_words': 129}