[icinga-checkins] icinga.org: icingaweb2/feature/translation-catalog-object-13012: CatalogHeader: Use new CatalogHeaderException

git at icinga.org git at icinga.org
Fri Nov 25 09:39:39 CET 2016


Module: icingaweb2
Branch: feature/translation-catalog-object-13012
Commit: 36262f78537b3240bab0cc40d194d18f5f2a9039
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=36262f78537b3240bab0cc40d194d18f5f2a9039

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Fri Nov 25 09:38:20 2016 +0100

CatalogHeader: Use new CatalogHeaderException


---

 .../library/Translation/Catalog/CatalogHeader.php            |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/translation/library/Translation/Catalog/CatalogHeader.php b/modules/translation/library/Translation/Catalog/CatalogHeader.php
index 30c8542..8134b90 100644
--- a/modules/translation/library/Translation/Catalog/CatalogHeader.php
+++ b/modules/translation/library/Translation/Catalog/CatalogHeader.php
@@ -5,8 +5,8 @@ namespace Icinga\Module\Translation\Catalog;
 
 use ArrayAccess;
 use Exception;
-use InvalidArgumentException;
 use Icinga\Exception\IcingaException;
+use Icinga\Module\Translation\Exceptions\CatalogHeaderException;
 
 /**
  * Class CatalogHeader
@@ -54,6 +54,8 @@ class CatalogHeader implements ArrayAccess
      * @param   string  $header
      *
      * @return  CatalogHeader
+     *
+     * @throws  CatalogHeaderException
      */
     public static function fromString($header)
     {
@@ -70,7 +72,7 @@ class CatalogHeader implements ArrayAccess
             try {
                 list($key, $value) = explode(': ', $line, 2);
             } catch (Exception $_) {
-                throw new InvalidArgumentException('Missing ": " in "' . $line . '"');
+                throw new CatalogHeaderException('Missing ": " in "' . $line . '"');
             }
 
             $headers[$key] = $value;
@@ -152,12 +154,12 @@ class CatalogHeader implements ArrayAccess
      *
      * @return  string
      *
-     * @throws  IcingaException
+     * @throws  CatalogHeaderException
      */
     public function render()
     {
         if (empty($this->headers)) {
-            throw new IcingaException('No headers to render');
+            throw new CatalogHeaderException('No headers to render');
         }
 
         $entries = array();



More information about the icinga-checkins mailing list