Refactored error handling
Refactored error handling

[#106994020]

Signed-off-by: Ben Calegari <9a58dcb4629f0f5a554e5de501c7fc8e7b1788bc@pivotal.io>

cloudfoundry-incubator/galera-healthcheck,cloudfoundry-incubator/galera-healthcheck