aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/exceptions
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-05-19 15:04:04 +0200
committerArthurHoaro <arthur@hoa.ro>2018-06-04 18:51:22 +0200
commitd3f42ca487287447efb81061609644108044a038 (patch)
tree6e9d5a33290f857c8f7a04dbdf8cf0ca749db149 /application/api/exceptions
parent17e45b2e9c33c736751e059276fadb480f98e621 (diff)
downloadShaarli-d3f42ca487287447efb81061609644108044a038.tar.gz
Shaarli-d3f42ca487287447efb81061609644108044a038.tar.zst
Shaarli-d3f42ca487287447efb81061609644108044a038.zip
Implements Tags endpoints for Shaarli's REST API
Endpoints: * List All Tags [GET] * Get a tag [GET] * Update a tag [PUT] * Delete a tag [DELETE] Fixes #904 References shaarli/api-documentation#34
Diffstat (limited to 'application/api/exceptions')
-rw-r--r--application/api/exceptions/ApiTagNotFoundException.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/application/api/exceptions/ApiTagNotFoundException.php b/application/api/exceptions/ApiTagNotFoundException.php
new file mode 100644
index 00000000..eed5afa5
--- /dev/null
+++ b/application/api/exceptions/ApiTagNotFoundException.php
@@ -0,0 +1,32 @@
1<?php
2
3namespace Shaarli\Api\Exceptions;
4
5
6use Slim\Http\Response;
7
8/**
9 * Class ApiTagNotFoundException
10 *
11 * Tag selected by name couldn't be found in the datastore, results in a 404 error.
12 *
13 * @package Shaarli\Api\Exceptions
14 */
15class ApiTagNotFoundException extends ApiException
16{
17 /**
18 * ApiLinkNotFoundException constructor.
19 */
20 public function __construct()
21 {
22 $this->message = 'Tag not found';
23 }
24
25 /**
26 * {@inheritdoc}
27 */
28 public function getApiResponse()
29 {
30 return $this->buildApiResponse(404);
31 }
32}