{"size": 326, "ext": "js", "max_stars_repo_path": "lib/init-error-handler.js", "max_stars_repo_name": "limejs/lime", "max_stars_repo_stars_event_min_datetime": "2019-03-03T02:53:54.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-23T06:36:16.000Z", "max_issues_repo_path": "lib/init-error-handler.js", "max_issues_repo_name": "limejs/lime", "max_issues_repo_issues_event_min_datetime": "2019-02-23T17:55:28.000Z", "max_issues_repo_issues_event_max_datetime": "2019-07-21T17:32:41.000Z", "max_forks_repo_path": "lib/init-error-handler.js", "max_forks_repo_name": "limejs/lime", "max_forks_repo_forks_event_min_datetime": "2019-02-27T07:35:49.000Z", "max_forks_repo_forks_event_max_datetime": "2019-02-27T07:35:49.000Z"}
{"max_stars_count": 3, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 25.0769230769, "max_line_length": 47, "alphanum_fraction": 0.6411042945}
module.exports = function () {
  // catch global error as early
  const originalError = this.context.onerror
  this.context.onerror = function (err) {
    // throw new Error('堆栈测试')
    originalError.call(this, err)
  }
  this.use(async (ctx, next) => {
    await next()
  })
  this._logger.ok('[core:error]', `异常机制初始化完成!`)
}
