Log errors in requests to analytics

This commit is contained in:
Alberto Fernández Capel
2018-03-19 09:56:44 +00:00
parent 6609c10d36
commit 07b0f37579
@@ -9,7 +9,10 @@ makeRequest = (opts, callback)->
if settings.apis?.analytics?.url?
urlPath = opts.url
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
request(opts)
request opts, (err) ->
if err?
logger.err { err: err }, 'Request to analytics failed'
callback() # Do not wait for all the attempts
else
callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))