Skip to content

Commit

Permalink
Merge pull request #161 from cristian-fleischer/main
Browse files Browse the repository at this point in the history
Fix CallWebhookJob behaviour when throwExceptionOnFailure is true
  • Loading branch information
freekmurze authored Dec 16, 2024
2 parents 600bd96 + 2ff3005 commit 72cd9fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CallWebhookJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Spatie\WebhookServer;

use Exception;
use Throwable;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
Expand Down Expand Up @@ -186,4 +187,11 @@ private function generateBody(): string
default => json_encode($this->payload),
};
}

public function failed(Throwable $e)
{
if ($this->throwExceptionOnFailure) {
throw $e;
}
}
}

0 comments on commit 72cd9fd

Please sign in to comment.