mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Internet: only catch InternetExceptions - anything else is an unexpected fault condition
This commit is contained in:
@ -24,11 +24,12 @@ declare(strict_types=1);
|
||||
namespace pocketmine\scheduler;
|
||||
|
||||
use pocketmine\utils\Internet;
|
||||
use pocketmine\utils\InternetException;
|
||||
|
||||
/**
|
||||
* Executes a consecutive list of cURL operations.
|
||||
*
|
||||
* The result of this AsyncTask is an array of arrays (returned from {@link Utils::simpleCurl}) or RuntimeException objects.
|
||||
* The result of this AsyncTask is an array of arrays (returned from {@link Utils::simpleCurl}) or InternetException objects.
|
||||
*
|
||||
* @package pocketmine\scheduler
|
||||
*/
|
||||
@ -56,7 +57,7 @@ class BulkCurlTask extends AsyncTask{
|
||||
foreach($operations as $op){
|
||||
try{
|
||||
$results[] = Internet::simpleCurl($op["page"], $op["timeout"] ?? 10, $op["extraHeaders"] ?? [], $op["extraOpts"] ?? []);
|
||||
}catch(\RuntimeException $e){
|
||||
}catch(InternetException $e){
|
||||
$results[] = $e;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user