upgraded dependencies
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace Facade\Ignition\Commands;
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use Exception;
|
||||
use Facade\FlareClient\Flare;
|
||||
use Facade\FlareClient\Http\Exceptions\BadResponseCode;
|
||||
use Illuminate\Config\Repository;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Log\LogManager;
|
||||
@@ -72,10 +75,47 @@ class TestCommand extends Command
|
||||
$testException = new Exception('This is an exception to test if the integration with Flare works.');
|
||||
|
||||
try {
|
||||
app('flare.client')->sendTestReport($testException);
|
||||
$this->info(PHP_EOL);
|
||||
app(Flare::class)->sendTestReport($testException);
|
||||
$this->info('');
|
||||
} catch (Exception $exception) {
|
||||
$this->warn('❌ We were unable to send an exception to Flare. Make sure that your key is correct and that you have a valid subscription. '.PHP_EOL.PHP_EOL.'For more info visit the docs on installing Flare in a Laravel project: https://flareapp.io/docs/ignition-for-laravel/introduction');
|
||||
$this->warn('❌ We were unable to send an exception to Flare. ');
|
||||
|
||||
if ($exception instanceof BadResponseCode) {
|
||||
$this->info('');
|
||||
$message = 'Unknown error';
|
||||
|
||||
$body = $exception->response->getBody();
|
||||
|
||||
if (is_array($body) && isset($body['message'])) {
|
||||
$message = $body['message'];
|
||||
}
|
||||
|
||||
$this->warn("{$exception->response->getHttpResponseCode()} - {$message}");
|
||||
} else {
|
||||
$this->warn($exception->getMessage());
|
||||
}
|
||||
|
||||
$this->warn('Make sure that your key is correct and that you have a valid subscription.');
|
||||
$this->info('');
|
||||
$this->info('For more info visit the docs on https://flareapp.io/docs/ignition-for-laravel/introduction');
|
||||
$this->info('You can see the status page of Flare at https://status.flareapp.io');
|
||||
$this->info('Flare support can be reached at support@flareapp.io');
|
||||
|
||||
$this->line('');
|
||||
$this->line('Extra info');
|
||||
$this->table([], [
|
||||
['Platform', PHP_OS],
|
||||
['PHP', phpversion()],
|
||||
['Laravel', app()->version()],
|
||||
['facade/ignition', InstalledVersions::getVersion('facade/ignition')],
|
||||
['facade/flare-client-php', InstalledVersions::getVersion('facade/flare-client-php')],
|
||||
['Curl', curl_version()['version']],
|
||||
['SSL', curl_version()['ssl_version']],
|
||||
]);
|
||||
|
||||
if ($this->output->isVerbose()) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user