Skip to content

Commit

Permalink
🥅 Catch webhook creation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
marcreichel committed Nov 7, 2021
1 parent e96cce8 commit 8379e36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Console/CreateWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace MarcReichel\IGDBLaravel\Console;

use Exception;
use Illuminate\Console\Command;
use InvalidArgumentException;
use MarcReichel\IGDBLaravel\Exceptions\AuthenticationException;
Expand Down Expand Up @@ -67,8 +68,10 @@ public function handle(): int

try {
$class::createWebhook($method);
} catch (AuthenticationException | InvalidWebhookMethodException | WebhookSecretMissingException $e) {
} catch (Exception $e) {
$this->error($e->getMessage());

return 1;
}

$this->info('Webhook created successfully!');
Expand Down

0 comments on commit 8379e36

Please sign in to comment.