|
@@ -104,7 +104,7 @@ |
|
|
block discarded – undo |
|
104
|
104
|
// Handle the error here, e.g. by logging it |
|
105
|
105
|
$attempts++; |
|
106
|
106
|
if ($attempts == $max_attempts) { |
|
107
|
|
- // Reached max attempts, so throw an exception to indicate failure |
|
|
107
|
+ // Reached max attempts, so throw an exception to indicate failure |
|
108
|
108
|
throw new Exception('Failed to retrieve data after ' . $max_attempts . ' attempts.'); |
|
109
|
109
|
} |
|
110
|
110
|
sleep(1); // Wait for 1 second before retrying |
Please login to merge, or discard this patch.