Router for quering MySQL results in NodeJS
Are we actually using the obj variable? It seems like you are not using it unless you were intending to pass to the render function. I don't think the try block is necessary. You can first check if results contains elements in it, so doing results[0].X will not return you an error since results[0] will never be undefined.

Here's an improved version:

router.get('/:id', function(req, res) {
  const getId = req.params.id;

  db.con.query('SELECT * FROM employees where id = ?', getId, function(err, results) {
    if (err || !results.length) {
      console.log('error in query');
      res.status(500).render('error', { error: err, id: getId });
      return;
    }

    var obj = {
      id: results[0].id,
      name: results[0].name,
      location: results[0].location
    };
    res.render('showuser', obj); // Assuming you're using obj to render
  });
});