From 44212e6248c93171ddedb51bfdb212ce8ffed695 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 3 Apr 2025 22:06:47 +0100 Subject: indicate error on failed push (status != 20x) --- Digitigrade/Job/PushObject.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Digitigrade/Job') diff --git a/Digitigrade/Job/PushObject.php b/Digitigrade/Job/PushObject.php index 0278eb5..1f3bcd9 100644 --- a/Digitigrade/Job/PushObject.php +++ b/Digitigrade/Job/PushObject.php @@ -29,8 +29,9 @@ class PushObject extends Job { $log = Logger::getInstance(); $log->info("pushing object $object->uri to server $instance->domain"); + $successful = false; try { - $instance->pushObject($object); + $successful = $instance->pushObject($object); } catch (EndpointMissingException $e) { $log->warning("can't push to $instance->domain because it has no push endpoint. giving up"); // and don't throw again here because we want it to look successful and not be retried @@ -43,5 +44,8 @@ class PushObject extends Job { $log->warning("can't push to $instance->domain because a policy rejected it. giving up"); // and don't throw again, pretty much same reasoning as above } + if (!$successful) { + throw new \RuntimeException("failed to push to $instance->domain"); + } } } \ No newline at end of file -- cgit v1.3