mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Webhook API
This commit is contained in:
@@ -123,10 +123,19 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
} catch (ClientException | Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
//$logs[] = sprintf('%s: %s', date('Y-m-d H:i:s'), $e->getMessage());
|
||||
|
||||
$logs = sprintf("%s\n%s", $e->getMessage(), $e->getTraceAsString());
|
||||
|
||||
$this->message->errored = true;
|
||||
$this->message->sent = false;
|
||||
$this->message->save();
|
||||
|
||||
$attempt = new WebhookAttempt;
|
||||
$attempt->webhookMessage()->associate($this->message);
|
||||
$attempt->status_code = $e->getResponse() ? $e->getResponse()->getStatusCode() : 0;
|
||||
$attempt->logs = $logs;
|
||||
$attempt->save();
|
||||
|
||||
return;
|
||||
}
|
||||
$this->message->save();
|
||||
|
Reference in New Issue
Block a user