diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-07-10 18:06:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 18:06:26 +0200 |
commit | c2c2338f9adecf971d01d7abcd09bab6275a9706 (patch) | |
tree | 9c8fe4d6c1ca1d5667b6bce786d872471322fac1 /application/api/exceptions | |
parent | edb4a4d9c9fbc01d67ee8d095fe26648714e2285 (diff) | |
parent | 6410bf96707e381685b7dafbefcccd83ea762934 (diff) | |
download | Shaarli-c2c2338f9adecf971d01d7abcd09bab6275a9706.tar.gz Shaarli-c2c2338f9adecf971d01d7abcd09bab6275a9706.tar.zst Shaarli-c2c2338f9adecf971d01d7abcd09bab6275a9706.zip |
Merge pull request #1141 from ArthurHoaro/api/tags
Implements Tags endpoints for Shaarli's REST API
Diffstat (limited to 'application/api/exceptions')
-rw-r--r-- | application/api/exceptions/ApiTagNotFoundException.php | 32 |
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 | |||
3 | namespace Shaarli\Api\Exceptions; | ||
4 | |||
5 | |||
6 | use 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 | */ | ||
15 | class 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 | } | ||