summaryrefslogtreecommitdiffstats
path: root/bl
diff options
context:
space:
mode:
Diffstat (limited to 'bl')
-rw-r--r--bl/feedbl.php8
-rw-r--r--bl/folderbl.php13
2 files changed, 15 insertions, 6 deletions
diff --git a/bl/feedbl.php b/bl/feedbl.php
index 9dc8cd312..0c0bbe9e0 100644
--- a/bl/feedbl.php
+++ b/bl/feedbl.php
@@ -58,7 +58,8 @@ class FeedBl extends Bl {
// first try if the feed exists already
try {
$this->mapper->findByUrlHash(md5($feedUrl), $userId);
- throw new BLException('Can not add feed: Exists already');
+ throw new BLException(
+ $this->api->getTrans()->t('Can not add feed: Exists already'));
} catch(DoesNotExistException $ex){}
try {
@@ -83,8 +84,9 @@ class FeedBl extends Bl {
return $feed;
} catch(FetcherException $ex){
$this->api->log($ex->getMessage());
- throw new BLException('Can not add feed with url' . $feedUrl .
- ': Not found or bad source');
+ throw new BLException(
+ $this->api->getTrans()->t(
+ 'Can not add feed: URL does not exist or has invalid xml'));
}
}
diff --git a/bl/folderbl.php b/bl/folderbl.php
index 3fcf48c7f..b542f3d34 100644
--- a/bl/folderbl.php
+++ b/bl/folderbl.php
@@ -25,14 +25,20 @@
namespace OCA\News\Bl;
+use \OCA\AppFramework\Core\API;
+
use \OCA\News\Db\Folder;
use \OCA\News\Db\FolderMapper;
class FolderBl extends Bl {
- public function __construct(FolderMapper $folderMapper){
+ private $api;
+
+ public function __construct(FolderMapper $folderMapper,
+ API $api){
parent::__construct($folderMapper);
+ $this->api = $api;
}
@@ -44,8 +50,9 @@ class FolderBl extends Bl {
private function allowNoNameTwice($folderName, $userId){
$existingFolders = $this->mapper->findByName($folderName, $userId);
if(count($existingFolders) > 0){
- throw new BLException('Error: Folder with name ' . $folderName .
- ' exists already!');
+
+ throw new BLException(
+ $this->api->getTrans()->t('Can not add folder: Exists already'));
}
}