]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/api/exceptions/ApiTagNotFoundException.php
Merge tag 'v0.10.4' into stable
[github/shaarli/Shaarli.git] / application / api / exceptions / ApiTagNotFoundException.php
diff --git a/application/api/exceptions/ApiTagNotFoundException.php b/application/api/exceptions/ApiTagNotFoundException.php
new file mode 100644 (file)
index 0000000..eee152f
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Shaarli\Api\Exceptions;
+
+use Slim\Http\Response;
+
+/**
+ * Class ApiTagNotFoundException
+ *
+ * Tag selected by name couldn't be found in the datastore, results in a 404 error.
+ *
+ * @package Shaarli\Api\Exceptions
+ */
+class ApiTagNotFoundException extends ApiException
+{
+    /**
+     * ApiLinkNotFoundException constructor.
+     */
+    public function __construct()
+    {
+        $this->message = 'Tag not found';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getApiResponse()
+    {
+        return $this->buildApiResponse(404);
+    }
+}