Small refactor of handleError
Small refactor of handleError

Signed-off-by: David Sabeti <c8d16735aef2518e18e5243f60d57b29b56e765b@pivotal.io>

simonjohansson/datadog-firehose-nozzle,simonjohansson/datadog-firehose-nozzle,CA-APM/epagent-nozzle,evoila/influxdb-firehose-nozzle,tmcgaughey/epagent-nozzle