aboutsummaryrefslogtreecommitdiff
path: root/app/Exceptions
diff options
context:
space:
mode:
authorGravatar Clément <clement@selfhost.fr> 2017-02-15 14:14:03 +0100
committerGravatar Clément <clement@selfhost.fr> 2017-02-15 14:14:03 +0100
commit5a1bb1393b4496eb35a2ffb3cc63d41c9dc1e2e5 (patch)
tree67028e45792c575c25c92616633f64cc7a4a13eb /app/Exceptions
parent7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff)
parent5f637bd816b7323885bfe1751a1724ee59a822f6 (diff)
Merge remote-tracking branch 'FreshRSS/master'
Diffstat (limited to 'app/Exceptions')
-rw-r--r--app/Exceptions/AlreadySubscribedException.php14
-rw-r--r--app/Exceptions/BadUrlException.php7
-rw-r--r--app/Exceptions/ContextException.php8
-rw-r--r--app/Exceptions/DAOException.php5
-rw-r--r--app/Exceptions/EntriesGetterException.php4
-rw-r--r--app/Exceptions/FeedException.php5
-rw-r--r--app/Exceptions/FeedNotAddedException.php14
-rw-r--r--app/Exceptions/OpmlException.php6
-rw-r--r--app/Exceptions/ZipException.php14
-rw-r--r--app/Exceptions/ZipMissingException.php4
10 files changed, 67 insertions, 14 deletions
diff --git a/app/Exceptions/AlreadySubscribedException.php b/app/Exceptions/AlreadySubscribedException.php
new file mode 100644
index 000000000..33b9f9555
--- /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/BadUrlException.php b/app/Exceptions/BadUrlException.php
index 7d1fe110e..d2509e4ba 100644
--- a/app/Exceptions/BadUrlException.php
+++ b/app/Exceptions/BadUrlException.php
@@ -1,6 +1,9 @@
<?php
+
class FreshRSS_BadUrl_Exception extends FreshRSS_Feed_Exception {
- public function __construct ($url) {
- parent::__construct ('`' . $url . '` is not a valid URL');
+
+ public function __construct($url) {
+ parent::__construct('`' . $url . '` is not a valid URL');
}
+
}
diff --git a/app/Exceptions/ContextException.php b/app/Exceptions/ContextException.php
new file mode 100644
index 000000000..00934cbfd
--- /dev/null
+++ b/app/Exceptions/ContextException.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * An exception raised when a context is invalid
+ */
+class FreshRSS_Context_Exception extends Exception {
+
+}
diff --git a/app/Exceptions/DAOException.php b/app/Exceptions/DAOException.php
new file mode 100644
index 000000000..14bee3403
--- /dev/null
+++ b/app/Exceptions/DAOException.php
@@ -0,0 +1,5 @@
+<?php
+
+class FreshRSS_DAO_Exception extends Exception {
+
+}
diff --git a/app/Exceptions/EntriesGetterException.php b/app/Exceptions/EntriesGetterException.php
index eaa330979..3b76195ee 100644
--- a/app/Exceptions/EntriesGetterException.php
+++ b/app/Exceptions/EntriesGetterException.php
@@ -1,7 +1,5 @@
<?php
class FreshRSS_EntriesGetter_Exception extends Exception {
- public function __construct ($message) {
- parent::__construct ($message);
- }
+
}
diff --git a/app/Exceptions/FeedException.php b/app/Exceptions/FeedException.php
index 50918ba95..abfcbce79 100644
--- a/app/Exceptions/FeedException.php
+++ b/app/Exceptions/FeedException.php
@@ -1,6 +1,5 @@
<?php
+
class FreshRSS_Feed_Exception extends Exception {
- public function __construct ($message) {
- parent::__construct ($message);
- }
+
}
diff --git a/app/Exceptions/FeedNotAddedException.php b/app/Exceptions/FeedNotAddedException.php
new file mode 100644
index 000000000..350a17c56
--- /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;
+ }
+}
diff --git a/app/Exceptions/OpmlException.php b/app/Exceptions/OpmlException.php
deleted file mode 100644
index e0ea3e493..000000000
--- a/app/Exceptions/OpmlException.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-class FreshRSS_Opml_Exception extends FreshRSS_Feed_Exception {
- public function __construct ($name_file) {
- parent::__construct ('OPML file is invalid');
- }
-}
diff --git a/app/Exceptions/ZipException.php b/app/Exceptions/ZipException.php
new file mode 100644
index 000000000..8441daedf
--- /dev/null
+++ b/app/Exceptions/ZipException.php
@@ -0,0 +1,14 @@
+<?php
+
+class FreshRSS_Zip_Exception extends Exception {
+ private $zipErrorCode = 0;
+
+ public function __construct($zipErrorCode) {
+ parent::__construct('ZIP error! ' . $url, 2141);
+ $this->zipErrorCode = $zipErrorCode;
+ }
+
+ public function zipErrorCode() {
+ return $this->zipErrorCode;
+ }
+}
diff --git a/app/Exceptions/ZipMissingException.php b/app/Exceptions/ZipMissingException.php
new file mode 100644
index 000000000..864cc3991
--- /dev/null
+++ b/app/Exceptions/ZipMissingException.php
@@ -0,0 +1,4 @@
+<?php
+
+class FreshRSS_ZipMissing_Exception extends Exception {
+}