Adding some resilience.

If an error occurs when registering then the exception is caught and the
30 second heartbeat continues. This means we keep trying until told to
stop.