function stopOnError(err) {
  if (err) {
    console.error(err)
  }

  console.log('Halting execution with exit code: 1')
  process.exit(1)
}
Logs error and exits script on failure

@param {Error} err If present, an error that occurred during script execution