code: function handleError(ctx, e, response) {
    if (response) {
      ctx.set(response.headers);
    }
  
    if (e instanceof UnauthorizedRequestError) {
      ctx.status = e.code;
    } else {
      ctx.body = {
        error: e.name,
        error_description: (e instanceof ServerError && ctx.app.config.env === 'prod') ? 'Server Error' : e.message,
      };
      ctx.status = e.code;
    }
    return ctx.app.emit('error', e, ctx);
  }
docs: Handle error.