Skip to content

Commit 72cd9fd

Browse files
authored
Merge pull request #161 from cristian-fleischer/main
Fix CallWebhookJob behaviour when throwExceptionOnFailure is true
2 parents 600bd96 + 2ff3005 commit 72cd9fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/CallWebhookJob.php

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Spatie\WebhookServer;
44

55
use Exception;
6+
use Throwable;
67
use GuzzleHttp\Client;
78
use GuzzleHttp\ClientInterface;
89
use GuzzleHttp\Exception\ConnectException;
@@ -186,4 +187,11 @@ private function generateBody(): string
186187
default => json_encode($this->payload),
187188
};
188189
}
190+
191+
public function failed(Throwable $e)
192+
{
193+
if ($this->throwExceptionOnFailure) {
194+
throw $e;
195+
}
196+
}
189197
}

0 commit comments

Comments
 (0)