mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 08:56:39 -06:00
Add moar debug
This commit is contained in:
parent
05d190659a
commit
ad0a1b9a24
@ -111,9 +111,11 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
try {
|
||||
$res = $client->request('POST', $this->message->webhook->url, $options);
|
||||
} catch (RequestException | ConnectException $e) {
|
||||
Log::error('The webhook could NOT be submitted but Firefly III caught the error below.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
|
||||
|
||||
$logs = sprintf("%s\n%s", $e->getMessage(), $e->getTraceAsString());
|
||||
|
||||
$this->message->errored = true;
|
||||
@ -125,6 +127,9 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
$attempt->status_code = 0;
|
||||
if (method_exists($e, 'hasResponse') && method_exists($e, 'getResponse')) {
|
||||
$attempt->status_code = $e->hasResponse() ? $e->getResponse()->getStatusCode() : 0;
|
||||
Log::error(sprintf('The status code of the error response is: %d', $attempt->status_code));
|
||||
$body = (string)($e->hasResponse() ? $e->getResponse()->getBody() : '');
|
||||
Log::error(sprintf('The body of the error response is: %s', $body));
|
||||
}
|
||||
$attempt->logs = $logs;
|
||||
$attempt->save();
|
||||
|
Loading…
Reference in New Issue
Block a user