-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 2c01e-field-logic-error-handling
- Loading branch information
Showing
15 changed files
with
471 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Listeners; | ||
|
||
use App\Notifications\Forms\FailedWebhookNotification; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Spatie\WebhookServer\Events\WebhookCallFailedEvent; | ||
|
||
class FailedWebhookListener | ||
{ | ||
/** | ||
* Handle the event. | ||
* | ||
* @param object $event | ||
* @return void | ||
*/ | ||
public function handle(WebhookCallFailedEvent $event) | ||
{ | ||
// Notify form owner | ||
if ($event->meta['type'] == 'form_submission') { | ||
$event->meta['form']->creator->notify(new FailedWebhookNotification($event)); | ||
\Log::error('Failed form submission webhook', [ | ||
'webhook_url' => $event->webhookUrl, | ||
'exception' => $event->errorType, | ||
'message' => $event->errorMessage, | ||
'form_id' => $event->meta['form']->id | ||
]); | ||
return; | ||
} | ||
|
||
\Log::error('Failed webhook', [ | ||
'webhook_url' => $event->webhookUrl, | ||
'exception' => $event->errorType, | ||
'message' => $event->errorMessage | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.