Retry connection for generic http 500 status error

instead of breaking the script immediately

Change-Id: Ib7f1b8bf39bb64fd0b365a58c77302847e406207
Merge "Retry connection for generic http 500 status error"