--- /dev/null
+<?php\r
+\r
+/**\r
+ * Throwable exceptions to return HTTP status code\r
+ *\r
+ * This list of Exception has be extracted from\r
+ * here http://racksburg.com/choosing-an-http-status-code/\r
+ */\r
+\r
+namespace Friendica\Network;\r
+\r
+use Exception;\r
+\r
+class HTTPException extends Exception {\r
+ var $httpcode = 200;\r
+ var $httpdesc = "";\r
+ public function __construct($message = "", $code = 0, Exception $previous = null) {\r
+ if ($this->httpdesc == "") {\r
+ $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', str_replace("Exception","",get_class($this)));\r
+ }\r
+ parent::__construct($message, $code, $previous);\r
+ }\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class BadGatewayException extends HTTPException\r
+{\r
+ var $httpcode = 502;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class BadRequestException extends HTTPException\r
+{\r
+ var $httpcode = 400;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class ConflictException extends HTTPException\r
+{\r
+ var $httpcode = 409;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class ExpectationFailedException extends HTTPException\r
+{\r
+ var $httpcode = 417;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class ForbiddenException extends HTTPException\r
+{\r
+ var $httpcode = 403;\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class GatewayTimeoutException extends HTTPException\r
+{\r
+ var $httpcode = 504;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class GoneException extends HTTPException\r
+{\r
+ var $httpcode = 410;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class ImATeapotException extends HTTPException\r
+{\r
+ var $httpcode = 418;\r
+ var $httpdesc = "I'm A Teapot";\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class InternalServerErrorException extends HTTPException\r
+{\r
+ var $httpcode = 500;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class LenghtRequiredException extends HTTPException\r
+{\r
+ var $httpcode = 411;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class MethodNotAllowedException extends HTTPException\r
+{\r
+ var $httpcode = 405;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class NonAcceptableException extends HTTPException\r
+{\r
+ var $httpcode = 406;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class NotFoundException extends HTTPException {\r
+ var $httpcode = 404;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class NotImplementedException extends HTTPException\r
+{\r
+ var $httpcode = 501;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class PreconditionFailedException extends HTTPException\r
+{\r
+ var $httpcode = 412;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class ServiceUnavaiableException extends HTTPException\r
+{\r
+ var $httpcode = 503;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class TooManyRequestsException extends HTTPException\r
+{\r
+ var $httpcode = 429;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class UnauthorizedException extends HTTPException\r
+{\r
+ var $httpcode = 401;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class UnprocessableEntityException extends HTTPException\r
+{\r
+ var $httpcode = 422;\r
+}\r
--- /dev/null
+<?php\r
+\r
+namespace Friendica\Network\HTTPException;\r
+\r
+use Friendica\Network\HTTPException;\r
+\r
+class UnsupportedMediaTypeException extends HTTPException\r
+{\r
+ var $httpcode = 415;\r
+}\r