chg: [outboxProcessors:brood] Gracefully catch server errors on remote broods
parent
244db2112c
commit
670c5abaae
|
@ -110,6 +110,14 @@ class ResendFailedMessageProcessor extends BroodsOutboxProcessor implements Gene
|
||||||
$dataSent = $outboxRequest->data['sent'];
|
$dataSent = $outboxRequest->data['sent'];
|
||||||
$response = $this->Broods->sendRequest($brood, $url, true, $dataSent);
|
$response = $this->Broods->sendRequest($brood, $url, true, $dataSent);
|
||||||
$jsonReply = $response->getJson();
|
$jsonReply = $response->getJson();
|
||||||
|
if (is_null($jsonReply)) {
|
||||||
|
$jsonReply = [
|
||||||
|
'success' => false,
|
||||||
|
'errors' => [
|
||||||
|
__('Brood returned an invalid JSON.')
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
$success = !empty($jsonReply['success']);
|
$success = !empty($jsonReply['success']);
|
||||||
$messageSuccess = __('Message successfully sent to `{0}`', $brood->name);
|
$messageSuccess = __('Message successfully sent to `{0}`', $brood->name);
|
||||||
$messageFail = __('Could not send message to `{0}`.', $brood->name);
|
$messageFail = __('Could not send message to `{0}`.', $brood->name);
|
||||||
|
|
Loading…
Reference in New Issue