import enchantGitlabInfo from './enchant-gitlab-info'

export default function(req, res, next) {
  enchantGitlabInfo(req.objectKind, req.body)
    .catch((err) => gitlabApiError(res, err))
    .then(() => next())
}

function gitlabApiError(res, err) {
  console.error(err)
  res.statusCode = 404
  res.end('Gitlab API NG : ' + err)
}

import enchantGitlabInfo from './enchant-gitlab-info'
import debug from 'debug'

export default function(req, res, next) {
  enchantGitlabInfo(req.objectKind, req.body)
    .catch((err) => gitlabApiError(res, err))
    .then(() => next())
}

function gitlabApiError(res, err) {
  debug('result')(err)
  res.statusCode = 404
  res.end('Gitlab API NG : ' + err)
}

Replace the console.log to the debug.
Replace the console.log to the debug.
