Added a retry mechanism

Any retryable error is not bubbled up to the application immediately,
but retried every second for up to 10 seconds before throwing an error