Add Horde_Exception_NotFound.
authorJan Schneider <jan@horde.org>
Tue, 9 Feb 2010 17:53:20 +0000 (18:53 +0100)
committerJan Schneider <jan@horde.org>
Wed, 10 Feb 2010 16:31:44 +0000 (17:31 +0100)
framework/Exception/lib/Horde/Exception/NotFound.php [new file with mode: 0644]
framework/Exception/package.xml

diff --git a/framework/Exception/lib/Horde/Exception/NotFound.php b/framework/Exception/lib/Horde/Exception/NotFound.php
new file mode 100644 (file)
index 0000000..2c90627
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Exception thrown if an object wasn't found.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Horde_Exception
+ */
+class Horde_Exception_NotFound extends Horde_Exception
+{
+    /**
+     * Constructor.
+     *
+     * @see Horde_Exception::__construct()
+     *
+     * @param mixed $message            The exception message, a PEAR_Error
+     *                                  object, or an Exception object.
+     * @param mixed $code_or_lasterror  Either a numeric error code, or
+     *                                  an array from error_get_last().
+     */
+    public function __construct($message = null, $code_or_lasterror = null)
+    {
+        if (is_null($message)) {
+            $message = _("Not Found");
+        }
+        parent::__construct($message, $code_or_lasterror);
+    }
+}
\ No newline at end of file
index 6ac7f3c..030cf66 100644 (file)
@@ -43,6 +43,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <dir name="lib">
     <dir name="Horde">
      <dir name="Exception">
+      <file name="NotFound.php" role="php" />
       <file name="PermissionDenied.php" role="php" />
      </dir> <!-- /lib/Exception -->
      <file name="Exception.php" role="php" />
@@ -63,6 +64,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  <phprelease>
   <filelist>
    <install name="lib/Horde/Exception.php" as="Horde/Exception.php" />
+   <install name="lib/Horde/Exception/NotFound.php" as="Horde/Exception/NotFound.php" />
    <install name="lib/Horde/Exception/PermissionDenied.php" as="Horde/Exception/PermissionDenied.php" />
   </filelist>
  </phprelease>