diff --git a/lib/unknownuriexception.php b/lib/unknownuriexception.php new file mode 100644 index 0000000000..2202e2d8cf --- /dev/null +++ b/lib/unknownuriexception.php @@ -0,0 +1,49 @@ +. + * + * @category Exception + * @package GNUsocial + * @author Mikael Nordfeldth + * @copyright 2014 Free Software Foundation, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 + * @link https://www.gnu.org/software/social/ + */ + +if (!defined('GNUSOCIAL')) { exit(1); } + +class UnknownUriException extends ServerException +{ + public $object_uri = null; + + public function __construct($object_uri, $msg=null) + { + $this->object_uri = $object_uri; + + if ($msg === null) { + // TRANS: Exception text shown when no object found with certain URI + // TRANS: %s is the URI. + $msg = sprintf(_('No object found with URI "%s"'), $this->object_uri); + common_debug(__CLASS__ . ': ' . $msg); + } + + parent::__construct($msg, 404); + } +}