<commit_before>export default () => {
  return async function (ctx, next) {
    try {
      await next()
    } catch (err) {
      console.log(err)
      const code = err.status || err.statusCode || 500
      const message = err.message || 'Internal Server Error'
      ctx.set('Message', message)
      ctx.status = code
      ctx.body = {
        code,
        message,
        ...err,
        stack: process.env.NODE_ENV === 'development' ? err.stack : undefined
      }
    }
  }
}<commit_msg>es6xfy errorhandler<commit_after>export default () => async (ctx, next) => {
  try {
    await next()
  } catch (error) {
    console.log(error)
    const { message = 'Internal Server Error', stack, status, statusCode } = error
    const code = status || statusCode || 500
    ctx.set('Message', message)
    ctx.status = code
    ctx.body = {
      code,
      message,
      ...error,
      stack: process.env.NODE_ENV === 'development' ? stack : undefined
    }
  }
}
{'fraction_non_alphanumeric': 0.13857290589451912, 'fraction_numerical': 0.007238883143743537, 'mean_word_length': 2.2266666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1855858', 'n_tokens_mistral': 301, 'n_tokens_neox': 293, 'n_words': 76}