summaryrefslogtreecommitdiff
path: root/app/Exceptions
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-24 23:29:49 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-24 23:29:49 +0200
commit324c83348ca44f3c13f4e0efeea25bbc96ed3b05 (patch)
treea1d5d07e6b9e463a5ecb69df81de117d2a32839d /app/Exceptions
parent0a79d4085b18c5607438f8ebd56543508e7db3a8 (diff)
Refactor controller add feed
Diffstat (limited to 'app/Exceptions')
-rw-r--r--app/Exceptions/AlreadySubscribedException.php14
-rw-r--r--app/Exceptions/FeedNotAddedException.php14
2 files changed, 28 insertions, 0 deletions
diff --git a/app/Exceptions/AlreadySubscribedException.php b/app/Exceptions/AlreadySubscribedException.php
new file mode 100644
index 000000000..f85d51300
--- /dev/null
+++ b/app/Exceptions/AlreadySubscribedException.php
@@ -0,0 +1,14 @@
+<?php
+
+class FreshRSS_AlreadySubscribed_Exception extends Exception {
+ private $feedName = '';
+
+ public function __construct($url, $feedName) {
+ parent::__construct('Already subscribed! ' . $url, 2135);
+ $this->$feedName = $feedName;
+ }
+
+ public function feedName() {
+ return $this->feedName();
+ }
+}
diff --git a/app/Exceptions/FeedNotAddedException.php b/app/Exceptions/FeedNotAddedException.php
new file mode 100644
index 000000000..02a8bc6be
--- /dev/null
+++ b/app/Exceptions/FeedNotAddedException.php
@@ -0,0 +1,14 @@
+<?php
+
+class FreshRSS_FeedNotAdded_Exception extends Exception {
+ private $feedName = '';
+
+ public function __construct($url, $feedName) {
+ parent::__construct('Feed not added! ' . $url, 2147);
+ $this->$feedName = $feedName;
+ }
+
+ public function feedName() {
+ return $this->feedName();
+ }
+}