```coffeescript
Promise = require 'bluebird'
async = Promise.coroutine
request = Promise.promisifyAll require 'request'
requestAsync = Promise.promisify request, multiArgs: true

{SERVER_HOSTNAME, POI_VERSION, ROOT} = global
{log, warn, error} = require './utils'

module.exports =
  checkUpdate: async (callback) ->
    try
      [response, body] = yield requestAsync "http://#{SERVER_HOSTNAME}/update/latest.json",
        method: 'GET'
        json: true
        headers:
          'User-Agent': "poi v#{POI_VERSION}"
      if response.statusCode == 200
        callback body
      else
        callback 'error'
    catch e
      error e
      callback 'error'
```

Fix an error that may lead to [ERROR] Error: getaddrinfo ENOTFOUND undefined undefined:80
user
```coffeescript
Promise = require 'bluebird'
async = Promise.coroutine
request = Promise.promisifyAll require 'request'
requestAsync = Promise.promisify request, multiArgs: true

{POI_VERSION, ROOT} = global
{log, warn, error} = require './utils'

module.exports =
  checkUpdate: async (callback) ->
    try
      [response, body] = yield requestAsync "http://#{global.SERVER_HOSTNAME}/update/latest.json",
        method: 'GET'
        json: true
        headers:
          'User-Agent': "poi v#{POI_VERSION}"
      if response.statusCode == 200
        callback body
      else
        callback 'error'
    catch e
      error e
      callback 'error'
```
assistant