aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Digitigrade/Job/PushObject.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/Digitigrade/Job/PushObject.php b/Digitigrade/Job/PushObject.php
index 1f3bcd9..82db4d3 100644
--- a/Digitigrade/Job/PushObject.php
+++ b/Digitigrade/Job/PushObject.php
@@ -29,9 +29,11 @@ class PushObject extends Job {
$log = Logger::getInstance();
$log->info("pushing object $object->uri to server $instance->domain");
- $successful = false;
try {
$successful = $instance->pushObject($object);
+ if (!$successful) {
+ throw new \RuntimeException("failed to push to $instance->domain");
+ }
} 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
@@ -44,8 +46,5 @@ 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