<commit_before>var express = require('express');
var router = express.Router();
var HaloAPI = require('haloapi');
var config = require("../config.js");
var h5 = new HaloAPI(config.apiKey);

var character = "Frankie";

/* GET home page. */

router.get('/api/weapons', function(req, res) {
  h5.metadata.weapons().then(function(weapons) {
    res.json(weapons);
  });
});

router.get('/api', function(req, res) {<commit_msg>added error handling to the first route<commit_after>var express = require('express');
var router = express.Router();
var HaloAPI = require('haloapi');
var config = require("../config.js");
var h5 = new HaloAPI(config.apiKey);

var character = "Frankie";

/* GET home page. */

router.get('/api/weapons', function(req, res) {
  h5.metadata.weapons()
    .then(function(weapons) {
      res.json(weapons);
    })
    .catch(function(error) {
      console.log(error);
    });
});

router.get('/api', function(req, res) {
{'fraction_non_alphanumeric': 0.1902231668437832, 'fraction_numerical': 0.004250797024442083, 'mean_word_length': 4.233333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4284642', 'n_tokens_mistral': 327, 'n_tokens_neox': 312, 'n_words': 69}