2018-02-09 03:49:49 +00:00
|
|
|
<?php
|
2024-08-24 15:27:00 +02:00
|
|
|
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-02-09 03:49:49 +00:00
|
|
|
|
|
|
|
namespace Friendica\Network;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
|
2020-02-09 16:34:23 +01:00
|
|
|
/**
|
|
|
|
* Throwable exceptions to return HTTP status code
|
|
|
|
*
|
|
|
|
* This list of Exception has been extracted from
|
|
|
|
* here http://racksburg.com/choosing-an-http-status-code/
|
|
|
|
*/
|
2019-05-01 21:24:51 -04:00
|
|
|
abstract class HTTPException extends Exception
|
2018-02-09 03:49:49 +00:00
|
|
|
{
|
2021-10-31 04:54:24 +00:00
|
|
|
protected $httpdesc = '';
|
|
|
|
protected $explanation = '';
|
2018-02-09 03:49:49 +00:00
|
|
|
|
2022-06-21 23:34:14 +02:00
|
|
|
public function __construct(string $message = '', Exception $previous = null)
|
2018-02-09 03:49:49 +00:00
|
|
|
{
|
2019-05-01 21:24:51 -04:00
|
|
|
parent::__construct($message, $this->code, $previous);
|
2018-02-09 03:49:49 +00:00
|
|
|
}
|
2021-10-31 04:54:24 +00:00
|
|
|
|
|
|
|
public function getDescription()
|
|
|
|
{
|
|
|
|
return $this->httpdesc;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getExplanation()
|
|
|
|
{
|
|
|
|
return $this->explanation;
|
|
|
|
}
|
2018-02-09 03:49:49 +00:00
|
|
|
}
|