]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/alreadyfulfilledexception.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / lib / alreadyfulfilledexception.php
1 <?php
2 /**
3  * GNU social - a federating social network
4  * Copyright (C) 2014, Free Software Foundation, Inc.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Affero General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 if (!defined('GNUSOCIAL')) { exit(1); }
21
22 /**
23  * Parent class for an exception when trying to do something that was
24  * probably already done.
25  *
26  * This is a common case for example when remote sites are not up to
27  * date with our database. For example subscriptions, where a remote
28  * user may be unsubscribed from our user, but they request it anyway. 
29  *
30  * This exception is usually caught in a manner that lets the execution
31  * continue _as if_ the desired action did what it was supposed to do.
32  *
33  * @category Exception
34  * @package  GNUsocial
35  * @author   Mikael Nordfeldth <mmn@hethane.se>
36  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
37  * @link     http://gnu.io/
38  */
39
40 class AlreadyFulfilledException extends ServerException
41 {
42     public function __construct($msg=null)
43     {
44         if ($msg === null) {
45             // TRANS: Exception text when attempting to perform something which seems already done.
46             $msg = _('Trying to do something that was already done.');
47         }
48
49         parent::__construct($msg, 409);
50     }
51 }