소스 검색

Log errors in requests to analytics

Alberto Fernández Capel 8 년 전
부모
커밋
07b0f37579
1개의 변경된 파일과 4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee

+ 4 - 1
services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee

@@ -9,7 +9,10 @@ makeRequest = (opts, callback)->
 	if settings.apis?.analytics?.url?
 	if settings.apis?.analytics?.url?
 		urlPath = opts.url
 		urlPath = opts.url
 		opts.url = "#{settings.apis.analytics.url}#{urlPath}"
 		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
 		callback() # Do not wait for all the attempts
 	else
 	else
 		callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))
 		callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))