<commit_before>var express = require('express'),
  path = require('path'),
  bodyParser = require('body-parser'),
  methodOverride = require('method-override'),
  errorHandler = require('errorhandler'),
  uniqid = require('uniqid'),
  mysql = require('mysql')

//initialize an express server
var app = express()

//create connection to mysql database
var connection = mysql.createConnection({
  host: 'localhost',
  user: 'nlproject',
  password: '<PASSWORD>',
  database: 'demo'
})

connection.connect();<commit_msg>add error handler for connection to mysql db<commit_after>var express = require('express'),
  path = require('path'),
  bodyParser = require('body-parser'),
  methodOverride = require('method-override'),
  errorHandler = require('errorhandler'),
  uniqid = require('uniqid'),
  mysql = require('mysql')

//initialize an express server
var app = express()

//create connection to mysql database
var connection = mysql.createConnection({
  host: 'localhost',
  user: 'nlproject',
  password: '<PASSWORD>',
  database: 'demo'
})

connection.connect(function(err) {
  if (err) {
    console.error('error connecting: ' + err.stack)
    return
  }
  console.log('connected as id ' + connection.threadId)
})
{'fraction_non_alphanumeric': 0.1495480690221857, 'fraction_numerical': 0.0, 'mean_word_length': 5.02970297029703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1701662', 'n_tokens_mistral': 345, 'n_tokens_neox': 346, 'n_words': 94}