summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-08-05 16:39:09 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-08-05 16:39:09 +0200
commitcb33a80b60b16942132cb356badaf9d18b0ca696 (patch)
tree0a0e2965938c23cd7c34492a17a4ae034aaf5803
parentf58dff275919263182fa740f05f9fd9213e30138 (diff)
ignore update errors when using the update script
-rw-r--r--bin/updater.py2
-rw-r--r--external/feedapi.php8
-rw-r--r--tests/unit/external/FeedAPITest.php6
3 files changed, 6 insertions, 10 deletions
diff --git a/bin/updater.py b/bin/updater.py
index 9e6d7b5a0..5c83b98b0 100644
--- a/bin/updater.py
+++ b/bin/updater.py
@@ -132,7 +132,7 @@ def main():
# register user and password for a certain url
auth = urllib.request.HTTPPasswordMgrWithDefaultRealm()
- auth.add_password(None, args.url, args.user, args.password)
+ auth.add_password("Authorisation Required", args.url, args.user, args.password)
auth_handler = urllib.request.HTTPBasicAuthHandler(auth)
opener = urllib.request.build_opener(auth_handler)
urllib.request.install_opener(opener)
diff --git a/external/feedapi.php b/external/feedapi.php
index 8eabd6942..684769c6e 100644
--- a/external/feedapi.php
+++ b/external/feedapi.php
@@ -213,11 +213,9 @@ class FeedAPI extends Controller {
try {
$this->feedBusinessLayer->update($feedId, $userId);
- return new JSONResponse();
- } catch(BusinessLayerException $ex) {
- return new JSONResponse(array('message' => $ex->getMessage()),
- Http::STATUS_NOT_FOUND);
- }
+ // ignore update failure (feed could not be reachable etc, we dont care)
+ } catch(BusinessLayerException $ex) {}
+ return new JSONResponse();
}
diff --git a/tests/unit/external/FeedAPITest.php b/tests/unit/external/FeedAPITest.php
index 2963125b2..9a092a84e 100644
--- a/tests/unit/external/FeedAPITest.php
+++ b/tests/unit/external/FeedAPITest.php
@@ -491,16 +491,14 @@ class FeedAPITest extends ControllerTestUtility {
}
- public function testUpdateNotFound() {
+ public function testUpdateError() {
$this->feedBusinessLayer->expects($this->once())
->method('update')
->will($this->throwException(new BusinessLayerException($this->msg)));
$response = $this->feedAPI->update();
- $data = $response->getData();
- $this->assertEquals($this->msg, $data['message']);
- $this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
+ $this->assertTrue($response instanceof JSONResponse);
}