diff options
| author | 2017-02-15 14:12:25 +0100 | |
|---|---|---|
| committer | 2017-02-15 14:12:25 +0100 | |
| commit | 2d097bc855dbd1ad06c7c306c05e78a198209084 (patch) | |
| tree | 67028e45792c575c25c92616633f64cc7a4a13eb /app/Exceptions | |
| parent | fe293900061263a1917fc1cf18ca369c8e07cb99 (diff) | |
| parent | 5f637bd816b7323885bfe1751a1724ee59a822f6 (diff) | |
Merge remote-tracking branch 'FreshRSS/master' into dev
Diffstat (limited to 'app/Exceptions')
| -rw-r--r-- | app/Exceptions/AlreadySubscribedException.php | 14 | ||||
| -rw-r--r-- | app/Exceptions/BadUrlException.php | 3 | ||||
| -rw-r--r-- | app/Exceptions/ContextException.php | 8 | ||||
| -rw-r--r-- | app/Exceptions/DAOException.php | 5 | ||||
| -rw-r--r-- | app/Exceptions/EntriesGetterException.php | 4 | ||||
| -rw-r--r-- | app/Exceptions/FeedException.php | 5 | ||||
| -rw-r--r-- | app/Exceptions/FeedNotAddedException.php | 14 | ||||
| -rw-r--r-- | app/Exceptions/ZipException.php | 14 | ||||
| -rw-r--r-- | app/Exceptions/ZipMissingException.php | 4 |
9 files changed, 65 insertions, 6 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 59574e1e5..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'); } + } 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 5f47c830b..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 2433b3964..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/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 { +} |
