<commit_before>import BaseRoute from 'pix-live/routes/base-route';

export default BaseRoute.extend({

  redirect(course) {
    const store = this.get('store');

    let assessment;

    return store.createRecord('assessment', { course, type: course.get('type') }).save()
      .then((createdAssessment) => assessment = createdAssessment)
      .then(() => store.queryRecord('challenge', { assessmentId: assessment.get('id') }))
      .then(challenge => this.replaceWith('assessments.challenge', { assessment, challenge }));
  }
});<commit_msg>Redirect to logout when there is an error<commit_after>import BaseRoute from 'pix-live/routes/base-route';

export default BaseRoute.extend({

  redirect(course) {
    const store = this.get('store');

    let assessment;

    return store.createRecord('assessment', { course, type: course.get('type') }).save()
      .then((createdAssessment) => assessment = createdAssessment)
      .then(() => store.queryRecord('challenge', { assessmentId: assessment.get('id') }))
      .then(challenge => this.replaceWith('assessments.challenge', { assessment, challenge }))
      .catch(() => {
        this.replaceWith('logout');
    });
  }
});
{'fraction_non_alphanumeric': 0.1669491525423729, 'fraction_numerical': 0.0, 'mean_word_length': 4.248888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '1206', 'n_tokens_mistral': 346, 'n_tokens_neox': 330, 'n_words': 69}