Replaced ConnectException with ConnectionException
This exception is thrown and handled when Mojang servers are down.
This commit is contained in:
parent
a3d0730808
commit
8d1e39c43c
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use GuzzleHttp\Exception\ConnectException;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
|
use Illuminate\Http\Client\ConnectionException;
|
||||||
|
|
||||||
class MojangStatusProvider extends ServiceProvider
|
class MojangStatusProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ class MojangStatusProvider extends ServiceProvider
|
||||||
$mcstatus = Http::get(config('general.urls.mojang.statuscheck'));
|
$mcstatus = Http::get(config('general.urls.mojang.statuscheck'));
|
||||||
Cache::put('mojang_status', base64_encode($mcstatus->body()), now()->addDays(3));
|
Cache::put('mojang_status', base64_encode($mcstatus->body()), now()->addDays(3));
|
||||||
}
|
}
|
||||||
catch(ConnectException $connectException)
|
catch(ConnectionException $connectException)
|
||||||
{
|
{
|
||||||
Log::critical('Could not connect to Mojang servers: Cannot check/refresh status', [
|
Log::critical('Could not connect to Mojang servers: Cannot check/refresh status', [
|
||||||
'message' => $connectException->getMessage()
|
'message' => $connectException->getMessage()
|
||||||
|
|
Loading…
Reference in New Issue